Smart pascal source code
----- // include_expr.inc //----------------
PrintLn({$I %FILE%}+','+{$INCLUDE %LINE%});
PrintLn({$I %FILE%}+','+{$INCLUDE %LINE%});
PrintLn(IntToStr({$I %LINENUM%}));
PrintLn({$I %MAINFILE%});
--------------------------------------------
WriteLn({$I %FILE%}+',' + {$INCLUDE %LINE%});
WriteLn({$I %FILE%}+',' + {$INCLUDE %LINE%});
WriteLn({$I %MAINFILE%}+',' + IntToStr(1000 + {$INCLUDE %LINENUM%}));
{$INCLUDE 'include_expr.inc'}
if FormatDateTime('yyyy-mm-dd', Now) <> {$I %DATE%} then
WriteLn('Date mismatch');
procedure MyFunc;
begin
WriteLn({$I %FUNCTION%});
end;
type
TMyClass = class
method MyMethod;
end;
method TMyClass.MyMethod;
begin
WriteLn({$I %FUNCTION%});
end;
WriteLn({$I %FUNCTION%});
MyFunc;
TMyClass.Create.MyMethod;
{<<< RESULT - CONSOLE LOG >>>
-----------------------------
*MainModule*,1
*MainModule*,2
Test\include_expr.pas,1003
include_expr.inc,1
include_expr.inc,2
3
Test\include_expr.pas
*Main*
MyFunc
TMyClass.MyMethod
-----------------------------
{<<<<<<<<< THE END >>>>>>>>>}