Remark

<remark>

──┬─<end remark>─────┬─────────────────────────────────────────────────┤
  ├─<comment remark>─┤
  └─<escape remark>──┘

<end remark>

Any sequence of letters, digits, and spaces not containing the reserved words END, ELSE, or UNTIL.

<comment remark>

── COMMENT ──<comment characters>── ; ─────────────────────────────────┤

<comment characters>

Any sequence of EBCDIC characters not containing a semicolon (;).

<escape remark>

── % ──<escape text>───────────────────────────────────────────────────┤

<escape text>

Any sequence of EBCDIC characters.

Remarks are provided as methods of inserting program documentation throughout an ALGOL source file.

The end remark can follow the language component END. The compiler recognizes the termination of the end remark when it encounters one of the reserved words END, ELSE, or UNTIL, or any nonalphabetic, nonnumeric EBCDIC character. Defines are not expanded within an end remark.

The comment remark is delimited by the word COMMENT at the beginning and a semicolon (;) at the end. The comment remark can appear between any two language components except within editing specifications.

Note: An apostrophe (') within a comment remark can cause a syntax error when the compiler is within an area that the compile-time facility is skipping. You should avoid the use of an apostrophe where possible.

Because remarks, string literals, and define invocations are language components, a comment remark is not recognized within a string literal, a define invocation, or another remark. Comment remarks can contain the dollar sign ($), but the comment remark must not contain a dollar sign as the first nonblank character on a source record. If a dollar sign is the first nonblank character on a source record, the compiler interprets the source record as a compiler control record. The compiler might not treat ”COMMENT“ in a definition as the beginning of a comment remark if the preceding character or the next character is a hyphen. Note that the compiler might need to interpret a hyphenated DM identifier with COMMENT as a part of the identifier name.

The percent sign (%) preceding escape text in an escape remark can follow any language component. The escape remark begins with the percent sign and extends to the beginning of the sequence number field of the record. The compiler does not examine the escape remark. When the percent sign that precedes an escape remark is encountered, the compiler skips immediately to the next record of the source file before continuing the compilation.

Examples

The following program illustrates some syntactically correct uses of the remark:

BEGIN
   FILE F(KIND=PRINTER COMMENT;);
   FORMAT COMMENT; FMT COMMENT; (A4,I6);
   PROCEDURE P(X,COMMENT;Y,Z);
      REAL X,Y COMMENT; ,Z;      % PERCENT SIGN CAN BE USED HERE
      X := Y + COMMENT; Z;       % HERE TOO
   IF COMMENT; 7 > 5 THEN
      WRITE(F,<"OK">);
   IF 4 COMMENT; > 2 THEN
      WRITE(F,<"OK">);
   IF 8 > 5 THEN
      WRITE COMMENT;(F,<"OK">);
END OF PROGRAM.

The following program illustrates some invalid uses of the remark:

BEGIN
   FILE F(KIND=PRINTER);
   FORMAT FMT(13,F10.3 COMMENT; ,A4);
   ARRAY A[0:99];
   REAL X;
   FORMAT ("ABC", % CANNOT BE USED. "DEE");
   WRITE(F,<"INVALID USE" COMMENT;>);
   REPLACE POINTER(A) BY "ABCD COMMENT;EFGHIJ";
   X := "AB,COMMENT;C";
   COMMENT CANNOT BE USED HERE COMMENT; EITHER;
END.