You are not logged in.
TTestChild = class(TSqlrecord)..
Ttest = class(TSqlrecord)
published
...
Child : TTestChild read FChild write FChild;
end;
//Retrieve child if exists
if ATest.Child <> nil then
begin
ATest.Child := TTestChild.Create(Database, ATest.Child);
Log(ATest.Child.Name);
end;
But now, how i test if child is retrevied to avoid to retrieve again?
And ATest.Child assigned with this form is freed when ATest is freed?
Offline
It depends on how the TTest class instance is created.
See http://synopse.info/files/html/Synopse% … ml#TITL_70
If you use CreateJoined, it will create the instance for you.
But IMHO the safest approach is to define a TID published property, and use a public property with a getter to create a TTestChild local instance.
Offline