D
Desmond Cassidy
Hi,
I'm sure this has been asked several times before but I'll risk it ;-)
If I wish to save an Arraylist to another Arraylist and work on te
original without affecting the contents of the new or saved Arraylist, how
is it done. It always seems to create a shallow copy i.e. by Reference.
I even tried passing the original Arraylist to a function by Value and
return a copy....after an arraylist.clear on the original it still clears
the saved Arraylist.
Thus the code I would like would be similar to the following
larrlstArrayListSave = larrlstArrayListOriginal
larrlstArrayListOriginal.Clear
BUT the larrlstArrayListSave should still have the collection in there.
I looked at .Clone and .CopyTo but they don't seem to cut !!!
It's annoying the hell out of me !!!
Any ideas ???
Cheers,
Desmond
I'm sure this has been asked several times before but I'll risk it ;-)
If I wish to save an Arraylist to another Arraylist and work on te
original without affecting the contents of the new or saved Arraylist, how
is it done. It always seems to create a shallow copy i.e. by Reference.
I even tried passing the original Arraylist to a function by Value and
return a copy....after an arraylist.clear on the original it still clears
the saved Arraylist.
Thus the code I would like would be similar to the following
larrlstArrayListSave = larrlstArrayListOriginal
larrlstArrayListOriginal.Clear
BUT the larrlstArrayListSave should still have the collection in there.
I looked at .Clone and .CopyTo but they don't seem to cut !!!
It's annoying the hell out of me !!!
Any ideas ???
Cheers,
Desmond