#1 2012-12-27 09:18:56

lele9
Member
Registered: 2011-10-28
Posts: 170

tcollection problem

hi ab,
i have a TSQLRecord descendant property of TCollection descendant type like this:

TRecapito = class (TCollectionItem)
   private
    FContatto: RawUTF8;
    FDescrizione: RawUTF8;
    FTipo: TTipoRecapito;
   published
    property Tipo: TTipoRecapito read FTipo write FTipo;
    property Descrizione: RawUTF8 index 100 read FDescrizione write FDescrizione;
    property Contatto: RawUTF8 index 100 read FContatto write FContatto;
   end;

TRecapiti = class (TCollection)
end;

TSQLPersona = class (TSQLBase)
   private
    ...
    FRecapiti: TRecapiti;
    ...
   public
    constructor Create; Override;
    destructor Destroy; Override;
   published
    ...
    property Recapiti: TRecapiti read FRecapiti write FRecapiti;
    ...
   end;

implementation


{ TSQLPersona }

constructor TSQLPersona.Create;
begin
   inherited;
   Self.FRecapiti := TRecapiti.Create(TRecapito);
end;

destructor TSQLPersona.Destroy;
begin
   FreeAndNil(Self.FRecapiti);
   inherited;
end;

now i update to last version of mormot and now Persona.Recapiti is always nil. Why?
Can you help me please?
Emanuele.

Offline

#2 2012-12-27 09:45:12

lele9
Member
Registered: 2011-10-28
Posts: 170

Re: tcollection problem

sorry ab,
i found the problem. its in my code...now it work!
thanks

Offline

Board footer

Powered by FluxBB