Difference between revisions of "Comments"

From Free Pascal wiki
Jump to navigationJump to search
m (Text replace - "delphi>" to "syntaxhighlight>")
Line 9: Line 9:
 
Example:
 
Example:
  
<delphi>
+
<syntaxhighlight>
 
     { public declarations }
 
     { public declarations }
</delphi>
+
</syntaxhighlight>
  
 
== Line comments ==
 
== Line comments ==
Line 19: Line 19:
 
Example:
 
Example:
  
<delphi>
+
<syntaxhighlight>
 
  // This is comment
 
  // This is comment
</delphi>
+
</syntaxhighlight>
  
 
== Read more ==
 
== Read more ==

Revision as of 15:01, 24 March 2012

Comments are human-readable notes or other kinds of annotations in support of the program code.

Block comments

Block comments delimited by { and } or (* and *).

  • { or (* is comment start
  • } or *) is comment end

Example:

    { public declarations }

Line comments

Line comments or inline comments start with comment delimiter // and continue until the end of the line.

Example:

 // This is comment

Read more