Assigned Function Result | ExceptObject



Assigned Function Result | ExceptObject
Smart pascal source code
{ main.pas } function Test(o : TObject) : TObject; begin Result:=o; end; function TestNil : TObject; begin Result:=nil; end; Begin if not Assigned(TObject.Create) then WriteLn('bug 1'); if not Assigned(Test(TObject.Create)) then WriteLn('bug 2'); if Assigned(Test(nil)) then WriteLn('bug 3'); if Assigned(TestNil) then WriteLn('bug 4'); if Assigned(ExceptObject) then WriteLn('bug 5'); { OUTPUT CONSOLE Runtime Error: ExceptObject is not defined }