Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
EnTerr
Level 8

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

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!  Smiley Tongue
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.
0 Kudos
2 Replies
Roku Employee
Roku Employee

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

"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."
Smiley Wink
0 Kudos
EnTerr
Level 8

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

In Soviet Russia... the wrongs right you! Smiley Wink



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
0 Kudos