Hoe kan je er altijd bij? Private is alleen zichtbaar voor code binnen dezelfde unit, niet in afgeleiden
Delphi Code:
type TFoo=class
private
fFoo1 : string;
public
property Foo1 : string read fFoo write fFoo;
end;
MyFoo = TFoo;
MyFoo.Foo1 := 'hallo'; // <---- dit mag
MyFoo.fFoo1 := 'hallo'; // <---- dit mag
Delphi Code:
type TFoo=class
strict private
fFoo1 : string;
public
property Foo1 : string read fFoo write fFoo;
end;
MyFoo = TFoo;
MyFoo.Foo1 := 'hallo'; // <---- dit mag
MyFoo.fFoo1 := 'hallo'; // <---- dit werkt niet
Bookmarks