CommentText function
Converts a string into a comment using the specified comment style.
Declaration
function CommentText(const s: string; CommentType: TCommentType)
: stringArguments
s | Value converted into a comment. |
CommentType | Comment type applied to the string. |
Function result
Comment with the specified style marker(s).
Description
CommentText is a
String function used to convert the
specified string into a comment using a given comment style.
CommentType is a
TCommentType value which indicates the
comment style applied to the value in
S. See
TCommentType for more information about the
enumeration values and their meanings.
No actions are performed in the function when CommentType contains
comtNone.
When CommentType contains comtDefault, the comtPascal
comment style is applied to the value in S.
An internal procedure is used to apply the starting marker (and ending marker when needed) as well as a continuation character sequence for a multi-line comment.
CommentText is used in the implementation of the source code editor in the
Lazarus IDE. An Exception can be raised if the comment length does
not match the expected length for the comment style.
Errors
Raises an Exception with the message 'CommentText ERROR: ' when an unexpected length is found for the commented value.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
