The only way i can think of is if you added an assign procedure into the object..
Code:
procedure TObject.Assign(const Source: TObject);
begin
var1 := Source.var1;
var2 := Source.var2;
.. etc ..
end;
In the case where you have TObject2 = Class(TObject) you can make the Assign a virtual procedure and you can do..
Code:
procedure TObject2.Assign(const Source: TObject); override;
begin
inherited Assign(Source);
If (Source Is TObject2) Then
Begin
newVar1 := TObject2(Source).newVar1;
newVar2 := TObject2(Source).newVar2;
End;
end;
Hope this helps
Bookmarks