PDA

View Full Version : Using compiler hints for quick jumping



User137
09-10-2010, 11:09 AM
I just figured an awesome way to use the compiler to replace most need for TODO-lists and stuff. Delphi and Lazarus for example always hints if a variable is not used and lets you click the line to quickly jump to the spot in code. I figured i might abuse this to give myself a quick way to jump and find code blocks i haven't completely finished.

Trick is to simply add a variable to your procedure/function for example:
unfinished: integer;
or even make it caps for more visibility.

This makes the compiler point you out if you have forgot to finish something. It comes up as "this variable is not used".

de_jean_7777
09-10-2010, 12:27 PM
Rather than use a compiler hint, you could use the {$NOTE} directive in FPC/Lazarus. Don't know if this is available in Delphi.


{$NOTE This code needs to be implemented.}Here is the FPC help page
http://www.freepascal.org/docs-html/prog/progsu52.html#x59-570001.1.52

User137
09-10-2010, 12:33 PM
Thanks, that works better and can be placed anywhere with details.

AthenaOfDelphi
09-10-2010, 03:08 PM
Later versions of Delphi have the 'MESSAGE' compiler directive. Full details can be found here (http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/compdirsmessagedirective_xml.html).

NecroDOME
09-10-2010, 03:18 PM
Delphi has a nice ToDo list...

AthenaOfDelphi
09-10-2010, 05:03 PM
That is true, although I don't actually use either of these methods much :-) I just try and remember what I have to do, or make a todo list on paper, which is more successful than trusting it to the old grey matter.

User137
22-02-2011, 10:42 PM
Rather than use a compiler hint, you could use the {$NOTE} directive in FPC/Lazarus. Don't know if this is available in Delphi.


{$NOTE This code needs to be implemented.}Here is the FPC help page
http://www.freepascal.org/docs-html/prog/progsu52.html#x59-570001.1.52

Bumping old topic just cause it became relevant again. $NOTE does not even compile on Delphi.

Edit:

{$MESSAGE 'Boo!'} works while requiring the ' '. Works in both Delphi and Lazarus.