Results 1 to 7 of 7

Thread: Using compiler hints for quick jumping

  1. #1

    Using compiler hints for quick jumping

    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".
    Last edited by User137; 09-10-2010 at 11:11 AM.

  2. #2
    PGDCE Developer de_jean_7777's Avatar
    Join Date
    Nov 2006
    Location
    Bosnia and Herzegovina (Herzegovina)
    Posts
    287
    Rather than use a compiler hint, you could use the {$NOTE} directive in FPC/Lazarus. Don't know if this is available in Delphi.

    Code:
    {$NOTE This code needs to be implemented.}
    Here is the FPC help page
    http://www.freepascal.org/docs-html/...59-570001.1.52
    Existence is pain

  3. #3
    Thanks, that works better and can be placed anywhere with details.

  4. #4
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2
    Later versions of Delphi have the 'MESSAGE' compiler directive. Full details can be found here.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  5. #5
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059
    Delphi has a nice ToDo list...
    NecroSOFT - End of line -

  6. #6
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2
    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.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  7. #7
    Quote Originally Posted by de_jean_7777 View Post
    Rather than use a compiler hint, you could use the {$NOTE} directive in FPC/Lazarus. Don't know if this is available in Delphi.

    Code:
    {$NOTE This code needs to be implemented.}
    Here is the FPC help page
    http://www.freepascal.org/docs-html/...59-570001.1.52
    Bumping old topic just cause it became relevant again. $NOTE does not even compile on Delphi.

    Edit:
    Code:
    {$MESSAGE 'Boo!'}
    works while requiring the ' '. Works in both Delphi and Lazarus.
    Last edited by User137; 22-02-2011 at 11:12 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •