How can I do a copy of an class instance ?

B

Ben

I created a class SampleClass. I have 2 instances a,b of this class.
I'd like to create a new instance c, based on informations on a and b,
and not starting from an empty object.

That is, I 'd like to create c as a real copy of a, and then add or
modify some its properties, using a and b. I don't know how to create a
real copy of a, and not just a link. If I do :

set c = a

and then I modify c's properties, it will modify a, which I don't want
to.

I know in Java f.ex. there is a "copy" method that would help me.
Any ideas ?

Thanks.
 
Top