Re: [fpc-pascal] Generic a "Clone" method

2009-06-16 Thread Martin Friebe
Torsten Bonde Christiansen wrote: Martin Friebe wrote: If any member (object variable) is of a ref-counted type (that is strings and dynamic arrays), then any "memory copy" will mess up. Because in the objects memory, there only are the pointers to the data of strings, and dyn-arrays. If

Re[2]: [fpc-pascal] Generic a "Clone" method

2009-06-16 Thread JoshyFun
Hello FPC-Pascal, Tuesday, June 16, 2009, 2:27:07 PM, you wrote: TBC> Martin Friebe wrote: >> There is Object.InstanceSize, which sounds as if it may be what you >> are looking for. >> But you have a bigger problem than that. TBC> Thanks - i'll try that. From my point of view a generic clone met

Re: [fpc-pascal] Generic a "Clone" method

2009-06-16 Thread Torsten Bonde Christiansen
Martin Friebe wrote: There is Object.InstanceSize, which sounds as if it may be what you are looking for. But you have a bigger problem than that. Thanks - i'll try that. If any member (object variable) is of a ref-counted type (that is strings and dynamic arrays), then any "memory copy" w

Re: [fpc-pascal] Generic a "Clone" method

2009-06-16 Thread Martin Friebe
Torsten Bonde Christiansen wrote: Hi. I was wondering if it is posible to make this type of construct for creating a generic Clone method: (I put it in pastebin): http://pastebin.com/fb495ed7 Explained in words - I'm trying to make a clone method that should be able to copy the content of

[fpc-pascal] Generic a "Clone" method

2009-06-16 Thread Torsten Bonde Christiansen
Hi. I was wondering if it is posible to make this type of construct for creating a generic Clone method: (I put it in pastebin): http://pastebin.com/fb495ed7 Explained in words - I'm trying to make a clone method that should be able to copy the content of private variables to a destination