Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
EnTerr
Roku Guru

Re: is <bitmap>.finish() no longer necessary?

"Komag" wrote:
But I've found that if I use Append(), it creates a new nested array just for ae with the new values:
ae[1].Append(["red","blue])
now only ae will be [ ["red","blue"], [] ]
ac will still be [ [], [] ]

No. ifList.Append() is a mutator, it changes (as it should be) underlying object, does not create copy:
BrightScript Debugger> X = [ [], [] ]
BrightScript Debugger> ae = X
BrightScript Debugger> ac = X
BrightScript Debugger> ae[1].Append(["red","blue"])
BrightScript Debugger> ? ae[1]
red
blue

BrightScript Debugger> ? ac[1]
red
blue
0 Kudos
Komag
Roku Guru

Re: is <bitmap>.finish() no longer necessary?

You're right, I got mixed up with the history of what I did. I now set up a new array before I append, so it's something new and not the single one they are all referencing
0 Kudos