jbrave
15 years agoChannel Surfer
array super weirdness...
BrightScript Debugger> x=["one","two","three"]
BrightScript Debugger> y=x
BrightScript Debugger> ?x
one
two
three
BrightScript Debugger> ?y
one
two
three
BrightScript Debugger> y[0]="four"
BrightScript Debugger> ?y
four
two
three
BrightScript Debugger> ?x
four
two
three
What the heck just happened here? Why does a change to y affect x? How do I create an independant copy of an array that doesn't change when the copy changes?
BrightScript Debugger> y=x
BrightScript Debugger> ?x
one
two
three
BrightScript Debugger> ?y
one
two
three
BrightScript Debugger> y[0]="four"
BrightScript Debugger> ?y
four
two
three
BrightScript Debugger> ?x
four
two
three
What the heck just happened here? Why does a change to y affect x? How do I create an independant copy of an array that doesn't change when the copy changes?