How to get a Copy an object ? (Value, not reference !)

S

Steph.

Hi,



I have an object TFieldInfoList derived from ArrayList.



How can I copy this object (the value, not the reference !) into an other one ?



FieldInfoList.CopyTo() doens't work

FieldInfoList.Clone() doens't work



FieldInfoList2 = TFieldInfoList1; doens't work because it copy the reference and I want a "value copy"...







Thanks,



Steph.
 
C

Chris Dunaway

The Clone method is the best, but you will probably have to override
the Clone method in your derived class to make sure it creates a new
object and does a deep copy of the properties.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top