[fpc-pascal] Clone a instance of object

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Sep 23 12:24:22 CEST 2013


On Mon, 23 Sep 2013 13:13:27 +0300
Zaher Dirkey <parmaja at gmail.com> wrote:

> On Mon, Sep 23, 2013 at 12:57 PM, Mattias Gaertner <
> nc-gaertnma at netcologne.de> wrote:
> 
> > type
> >  TMyClass = class(TPersistent)
> >  private
> >    type
> >      TMyClassVars = record
> >        a,b,c: string;
> >      end;
> >  private
> >    F: TMyClassVars;
> >  public
> >    procedure Assign(Source: TPersistent);
> >    property a: string read F.a write F.a;
> >  end;
> >
> 
> ​But in derived classes fields will not assigned​?

Derived classes can use the same technique.

Mattias



More information about the fpc-pascal mailing list