Declared keyword



Declared keyword
Smart pascal source code
type TMyRecord = record Dummy: Integer; end; { main.pas } var myVar: String = IntToStr(2); Begin if Declared('dummy') then WriteLn('bug dummy'); if not Declared('TObject') then WriteLn('bug TObject'); if not Declared('TObject.Create') then WriteLn('bug TObject.Create'); if not Declared('Internal.TObject.Create') then WriteLn('bug Internal.TObject.Create'); if not Declared('Internal.Sin') then WriteLn('bug Internal.Sin'); if not Declared('TMyRecord') then WriteLn('bug TMyRecord'); if not Declared('TMyRecord.Dummy') then WriteLn('bug TMyRecord.Dummy'); if Declared('TMyRecord.Oops') then WriteLn('bug TMyRecord.Oops'); {$IF Declared('dummy')} WriteLn('Dummy is declared (bug)'); {$ENDIF} {$IF not Declared('dummy')} WriteLn('Dummy is not declared'); {$ENDIF} { <<<<<<<<<<<< CONSOLE OUTPUTS >>>>>>>>>>>>>>>>>>> Dummy is not declared }