Hi all,
I like to use objects as data container only: (records with "inheritence", no methods.)
type tHead=object ID :integer; sum :integer; end;
type tFoo1=object(tHead) data:float; end;
type tFoo2=object(tHead) data:longint; end;
var headvar:tHead; foo1var:tFoo1;
Head:=foo1; <- gpc gives "invalid explicit assignment between objects"
//BP and Delphi assign with the statement above all common fields: // Headvar.ID :=foo1var.ID // Headvar.sum :=foo1var.sum
it there a legal way to get the base-data from foo1var into headvar at once?
Thanks David
David Ulbrich wrote:
I like to use objects as data container only: (records with "inheritence", no methods.)
type tHead=object ID :integer; sum :integer; end;
type tFoo1=object(tHead) data:float; end;
type tFoo2=object(tHead) data:longint; end;
var headvar:tHead; foo1var:tFoo1;
Head:=foo1; <- gpc gives "invalid explicit assignment between objects"
//BP and Delphi assign with the statement above all common fields: // Headvar.ID :=foo1var.ID // Headvar.sum :=foo1var.sum
it there a legal way to get the base-data from foo1var into headvar at once?
No, currently only field-by-field assignment is possible.
We might implement this feature soon.
Frank