Another form of a multiple line comment
(* some comments go here*)
Speaking of comments:
// I am a Single line comment
Multiple levels of comments. You can nest comments like the example below
(* I am a comment { I am a comment within a comment }*)
The hierarchy of comments:
(* comment *) = highest precedence{ comment }// comment
Contrl + / Shortcut
To mark or unmark a series of lines of code with a comment
Highlight the lines of code you wish to comment out - hold down the shift key and move cursor up or down.
Hit Ctrl + / and the lines will be commented out. If they already were commented out, they will no longer be commented
Before:
if (something) thenbegin ShowMessage('I did it.');end;
After:
//if (something) then, //begin, // ShowMessage('I did it.');, //end;
|
Regarding...
Delphi Comments (// or { ... } or (* ... *))
Languages Focus: CommentsCommenting code generally has three purposes: to document your code, for psuedo coding prior to coding, and to embed compiler directives. Most languages support both a single line comment and a multiple line comment. Some languages also use comments to give instructions to the compiler or interpreter.
Delphi CommentsCommenting Code, Delphi uses // for a single line comment and both {} and (**) for multiple line comments. Although you can nest different types of multiple line comments, it is recommended that you don't.
Compiler Directives - $, A special comment. Delphi compiler directives are in the form of {$DIRECTIVE}. Of interest for comments is using the $IFDEF compiler directive to remark out code.
|
|