On Mon, 23 Sep 2013, Zaher Dirkey wrote:


On Mon, Sep 23, 2013 at 10:02 AM, Michael Van Canneyt <mich...@freepascal.org> 
wrote:
      Var
        C : TBaseObjectClass;
      begin
        C:=TBaseObjectClass(ClassType);
        Result:=C.Create;
      end;


​Yes, that help me, thanks.

Now about assigning I must repeat it (assign) for every child class copy its 
field members, is there any trick to copy the values like assigning record var 
to another record
var?
I know it is kind of strange way :P

There is no such safe mechanism.

The best you can do is make the properties published, and write an RTTI lookup 
routine that copies all Published values.
I've done this several times, it works well for most situations.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to