[lazarus] FPC Comment handling

Michael Van Canneyt michael.vancanneyt at wisa.be
Tue Aug 17 03:49:21 EDT 1999




On Mon, 16 Aug 1999, Jeff Wormsley wrote:

> I have noticed that one of my favorite debugging methods doesn't work in FPC.  It involves the way I comment test code for easy inclusion/exclusion.  What I do is this:
> 
> {!}{ SomeVar := SomeValue;{}
> 
> to comment the code out, and then
> 
> {!}  SomeVar := SomeValue;{}
> 
> to put it in.  This way only one character needs typing to put in or take out a piece of test code.  I use the {!} as a search parameter to find all of my debugging code for later inclusion or removal.
> 
> Unfortunately, FPC objects to having a { {} type construct, and instead wants { } only.  
> 
> Where possible, I have changed to {!}// but this is only good for one liners, obviously.
> 
> This is just a comment (no pun intended), and not really a bug, I suppose, although it works in Delphi.

FPC supports nested comments, this is the reason of your problem.
However, using Delphi mode, it should be accepted; so if you want to use this,
do a -Sd instead of -S2; but then you will have some other side effects as well...

Michael.






More information about the Lazarus mailing list