Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-08

FPC Comment handling

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to Jeff Wormsley: I have noticed that one of my favorite debugging methods doesn't work in FPC. It…
Jeff Wormsley wrote 15 lines
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.

Reply by email

Jeff Wormsley

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.

Jeff.

Reply by email