Hi,
changing a value in the copy of a list does
the same in the soruce list?
Does TList.copy only create a new reference?
I am really confused:
changing a value in the copy of a list does
the same in the soruce list?
Does TList.copy only create a new reference?
I am really confused:
Type Test Field one:Int = 1 End Type ' create a new list Local mylist:TList = CreateList() ' create an object Test with one=1 t:Test = New Test DebugLog (t.one) ' add it to list mylist mylist.AddLast(t) ' create a new list Local mylistcopy:TList = CreateList() ' and fill it with a copy of mylist mylistcopy = mylist.copy() ' Change value of t.one in copy of mylist For Local lp:Test = EachIn mylistcopy lp.one = 5 Next ' Now the value in mylist is changed to 5 ??? For Local lpp:Test = EachIn mylist DebugLog (lpp.one) Next