mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 22:49:34 +02:00
29 lines
405 B
ObjectPascal
29 lines
405 B
ObjectPascal
{$mode objfpc}{$h+}
|
|
|
|
type
|
|
tobj=class(TObject)
|
|
ffield:boolean;
|
|
constructor Create;
|
|
procedure AfterConstruction;override;
|
|
end;
|
|
|
|
{ Exit statement in constructor must not jump over AfterConstruction! }
|
|
constructor tobj.Create;
|
|
begin
|
|
exit;
|
|
end;
|
|
|
|
procedure tobj.AfterConstruction;
|
|
begin
|
|
ffield:=true;
|
|
end;
|
|
|
|
|
|
var
|
|
o: tobj;
|
|
begin
|
|
o:=tobj.create;
|
|
if not o.ffield then
|
|
Halt(1);
|
|
end.
|