| Introduction | MTB Statements | File System | Compiler | Applications | Reference Guide | Index |
| Language Structure | Data Division | I/O Format Division | Procedure Division | Mnemonics |
If the exclamation mark is used as the first character on a line, the entire line will be ignored by the compiler and treated as a programmer comment.
If the exclamation mark is used anywhere else on a source line, the first part of the line (up to the exclamation mark) will be compiled and the remainder of the line will be ignored. This is a convenient way to place comments on the same line as source statements.
Example 1:
! THIS ENTIRE LINE WILL BE TREATED AS A COMMENTIn this example, the whole source line will be ignored because the comment character appears as the first character on the line.
Example 2:
LET A = B*C/D ! THIS COMMENT FOLLOWS A STATEMENTIn this example, the comment character follows an executable statement. The compiler will compile the first part of the line, but ignore the characters from the exclamation mark to the end of the line.