[fpc-pascal] Clone a instance of object
Zaher Dirkey
parmaja at gmail.com
Mon Sep 23 08:03:56 CEST 2013
On Mon, Sep 23, 2013 at 8:50 AM, Sven Barth <pascaldragon at googlemail.com>wrote:
> You need to add a "Result.Assign(Self)" to your clone call and implement
> a virtually inherited "Assign" method in each class where you copy all
> fields. This is how "TPersistent" and its descendants do it as well.
Yes I added assign, but as example above, it is crashed when creating it
Result:=TBaseObject(ClassType).Create;
--
I am using last revision of Lazarus, FPC 2.6 on Windows XP SP3
Best Regards
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130923/f4fd94cd/attachment.html>
More information about the fpc-pascal
mailing list