Your Digital Media Has Never Looked So Good

 
EnTerr
** Valued Community Member **
Topic Author
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

"ERROR: roArray.Append: parameter is self reference"

Sun Oct 02, 2016 8:12 pm

BrightScript Debugger> l = [1,2]: l.append(l): ? l
BRIGHTSCRIPT: ERROR: roArray.Append: parameter is self reference
<Component: roArray> =
[
     1
     2
]

Okay, so this is just lazy!  :P
Best would be if it actually worked, like in "normal" languages. If it doesn't though, it should be a proper error and not a warning.
 
User avatar
RokuKC
Posts: 313
Joined: Wed Sep 10, 2014 10:44 am
Location: Roku HQ

Re: "ERROR: roArray.Append: parameter is self reference"

Mon Oct 03, 2016 3:47 pm

EnTerr wrote:
BrightScript Debugger> l = [1,2]: l.append(l): ? l
BRIGHTSCRIPT: ERROR: roArray.Append: parameter is self reference



"Doctor, it hurts when I do this!"
"Then don't do that."
:wink:
 
EnTerr
** Valued Community Member **
Topic Author
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: "ERROR: roArray.Append: parameter is self reference"

Mon Oct 03, 2016 8:28 pm

In Soviet Russia... the wrongs right you! :wink:

Image

sub appendoplasty(l1, l2): 
  'if l1 <> l2 then l1.append(l2): return   'alas, case of "the dog in the manger"
  tmp = []
  tmp.append(l2)
  l1.append(tmp)
end sub

Who is online

Users browsing this forum: No registered users and 7 guests