Comments are ignored by the
compiler, except when they function as separators (delimiting adjacent tokens)
or compiler directives.
There are several ways to
construct comments:
{ Text between a left brace and a right
brace constitutes a comment. }
(* Text between a
left-parenthesis-plus-asterisk and an
asterisk-plus-right-parenthesis also constitutes a comment. *)
// Any text between a double-slash
and the end of the line constitutes a comment.
A comment that contains a dollar
sign ($) immediately after the opening { or (* is a compiler directive. For
example,
{$WARNINGS OFF}
tells the compiler not to generate warning messages.
当注释既不是分隔符(作为边界隔开与其相邻的标记)也不是编译指示时,将被编译器忽略。
以下是构造注释的几种方式:
{ 位于左花括号和右花括号之间的文本构成注释。文本可以多于一行。}
(* 位于左圆括号加星号和星号加右圆括号之间的文本也构成注释。
文本可以多于一行。 *)
// 任何位于双斜杠与行尾之间的文本构成注释。文本只能是一行。
当作为注释开始的 { 或 (* 标志之后紧随一个美圆符号($)时,该注释是一个编译指示。例如:
{$WARNINGS OFF}
该编译指示告诉编译器不要产生警告信息。