Good morning,
could anyone help me in this?
In Delphi-6 I have a piece of code which declares
var MyList, TempList: TList;
MyList has some items. TempList has the same items in a different order. Both lists refer to pointers of the same type.
How can I move TempList to the var MyList? I do not wish to execute re-ordering directly in MyList since it might no be definitive.
When I assign
MyList := TempList;
all looks fine, although freeing lists produces following error
"Access violation at address [addr]. Read of address [addr]"
Thank you for the attention
Nikiforos
When you do MyList := TempList, both vars point to the same list, if you that list, both variables become invalid.
try something like:
Open in new window