[Lazarus] Methods and stacks

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Fri Jul 23 12:51:05 CEST 2010


Hi!

Am 23.07.2010 00:58, schrieb waldo kitty:
> on the surface, this would seem to be similar to the C style
> preprocessor stuff that takes "macros" like __DATE__ and __TIME__ and
> converts them to the current date and time and writes them into the
> object code... i did something like this for TP6/BP6 way back in the
> day... set those as consts in an include that was rewritten each time by
> my preprocessor before the command line compiler was called... actually
> using them (ie: forcing them to be included in the binary) required that
> at least one const string be used in the execution of the program...
> these didn't have to be used in the code but they were included such
> that one could see them in the binary when it was viewed via a hex
> editor/viewer...

Did you know about this:

===

program Foo;

{$apptype console}

begin
   Writeln({$I %DATE%} + ' ' + {$ %TIME%});
   Readln;
end.

===

Output:

2010/07/23 10:13:40

===

It's documented here: 
http://www.freepascal.org/docs-html/prog/progsu38.html#x45-430001.1.38

Regards,
Sven




More information about the Lazarus mailing list