[lazarus] Win32 Installer/Lazarus

Peter Vreman pfvreman at wins.uva.nl
Wed Jul 21 09:56:20 EDT 1999


> > Exact. But I am not sure whether the parser supports
> > {$DEFINE DEBUG:=//}
> > the // comment may confuse it. Has this been tested ?
> 
> It works like a charm here is how I set it up.
> 
> program test;
> 
> {$define DEBUGOUT:=//}
> 
> begin
>    writeln('first line');
>    DEBUGOUT ('*** debug line ***');
>    writeln('last line');
> end.
> 
> When done this way I only get the 2 writeln statements. When I changed
> it to this.
> 
> program test;
> 
> {$define DEBUGOUT:=writeln}
> 
> begin
>    writeln('first line');
>    DEBUGOUT ('*** debug line ***');
>    writeln('last line');
> end.
> 
> I get all 3 lines. Works cool.
> 
> I had hoped I could do something like this.
> 
> {$define //DEBUGOUT:=writeln}
> 
> begin
> .
> .
>    //DEBUGOUT ('debug text');
> .
> .
> end.
> 
> This way if the macro wasn't defined or if -Sm was set it would just
> take the line as a comment. Infortunately it doesn't appear that the
> define statement can handle a macro named with leading '//' characters.
> 
> Hey compiler guys any chance that this is changable? That would make the
> code really slick if it could be self commenting lines.
Then we should also allow things like

{$define {:=hello}

Do you really want to make a mess with such macro's?

// is comment and is parsed like that. The macro's are only replaced after
a identifier is read.


Peter






More information about the Lazarus mailing list