[Gambas-user] Cloning instances of a class to make an exact copy

nando nando_f at ...951...
Thu Jul 21 04:24:24 CEST 2011


Question:

Assume I have an instance of class myclass dimed as 'myclass1'
and I want to clone all the data to NEW myclass2

The syntax may be something like:

myclass2 = NEW myclass   'create instance
myclass2.clone(myclass1) 'clone/copy

I do realize that:
myclass2 = myclass2   only assigns a second pointer to the same single object


I am assuming that there is no copy/clone of an instance to another
to make an exact replica copy, not just pointers to objects

In the mean time, I'll start writing a copy/clone sub

??
-Fernando




More information about the User mailing list