Re: [fpc-pascal]Classes and copying

2003-02-12 Thread Sebastian Günther
Matt D. Emson schrieb: Having said all that, it works really well in Delphi, and I assume Delphi mode (S2 or Sd). Does the TP or the ObjFPC mode support RTTI and the Typinfo unit? Yes, what you have described should work well in FPC, too. - Sebastian _

RE: [fpc-pascal]Classes and copying

2003-02-12 Thread Matt D. Emson
> This indeed only copies the pointer. if you want to do more > than that, then you need to implement this yourself. > > TPersistent implements the 'Assign' method for this. You can > create a descendent from TPersistent, override the Assign > method, and then copy fields as necessary in the ne

Re: [fpc-pascal]Classes and copying

2003-02-12 Thread Michael Van Canneyt
On Wed, 12 Feb 2003, James Mills wrote: > Hi all, > > With respect to classes (and perhaps also objects), how do you copy the > contents of a class in memory (an object) to another? > > ie: > > var > a: TClass; >b: TClass; > > begin > a := TClass.init; > b := a; //This only copies