Previous Topic: Coding User-Supplied ValuesNext Topic: Compiler-Directive Statements


Coding Comment Text

You can add comments to SCHEMA, SUBSCHEMA, RECORD element substatement, and LOGICAL record definitions in the COMMENTS clause. Rules for coding comment-text appear next.

Text Can Be Any Length

Text can extend to any length. Code as many lines as are necessary to document the entity.

Use Quotes on Each Line

A quote must precede the text of each line; ending quotes on each line are optional. When COMMENTS is the last clause in the statement and the terminating quote (at the end of the last line) is omitted, code the period on a separate line; otherwise, the compiler treats the period as part of the comment.

Multiline Input

When text extends beyond the first line of input, each subsequent line must begin with a character indicating either continuation or concatenation, as follows:

Line type

Symbol

Meaning

Continuation

Hyphen (-)

Compilers treat the new line as a continuation of comment text

Concatenation

Plus (+)

Compilers append the new line to the preceding line of comment text; any number of text lines can be concatenated, provided that their combined length does not exceed 80 bytes

Examples

The following example of the SUBSCHEMA statement compares valid omissions of a terminating quote with an invalid omission. In the third statement, the subschema compiler assumes that the period is part of the comment and that ADD RECORD was meant to be a clause of the SUBSCHEMA statement; because this is not valid syntax, the compiler flags ADD RECORD as an error.

The following example illustrates continuation and concatenation: