Using comments

To insert a comment

The Editor inserts the proper syntax for comments based on the programming language you are using. If the Editor is not using the correct syntax, choose View > Language to make sure it is set to the correct language. Block comment operations are not supported in FORTRAN or Green Hills Script.

  1. If you want to comment out existing code, highlight the text. If there is no highlighted selection, the entire line the cursor is currently on will be commented out by default.
    - or -
    If you want to insert a new comment, place the cursor on a blank line where you want the comment to start.
  2. Choose Block > Comment.
  3. Select the code you wish to comment and then right-click it and choose Comment from the pop-up menu.

If you want to uncomment a comment block, highlight the block and choose Block > UnComment or right-click the selected block and choose Uncomment from the pop-up menu.

To keep comments flush-left

If you want comments in your code to stay flush-left even when you auto-indent your code:

  1. Choose Config > Options....
  2. On the Editor tab, select Comments Stick Flush Left.
  3. Enter your comments next to the left margin.

Note: If you insert # as the first character of a comment, then the comment will move to the left margin regardless of the position where you started the comment. For example, if you are coding in C and enter /*#, then the comment automatically moves to the left margin.

Related topic:


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.