| Introduction | MTB Statements | File System | Compiler | Applications | Reference Guide | Index |
| Language Structure | Data Division | I/O Format Division | Procedure Division | Mnemonics |
The Comet Editor utility program (CED) employs line numbers to maintain the sequence of lines in a source program. Line numbers range from 1 to 9999999. Line numbers are not part of the MTB source statement itself and are not referenced from within the program.
However, some MTB statements employ statement labels that are a part of the MTB source statement.
Format statement labels are required for every FORMAT statement, while statement labels in the Procedure Division are used only for statements that are logical branch points in the program (e.g., subroutines, exception routines, branch-to routines).
The MTB compiler views format labels and statement labels in two distinct groups. Therefore, it is possible to use the same label in both the I/O Format Division and the Procedure Division.
Labels may be numeric or alphanumeric.
|
Numeric labels
|
|
Alphanumeric labels
|
Example 1:
Editor line number Label Statement ================================================================= 100 SCREEN: FORMAT "THIS IS AN I/O FORMAT STATEMENT." 200 . 300 . 400 . 500 START: PRINT (0,SCREEN) 600 . 700 . 800 . 900 GOTO STARTIn this example, the Comet editor line numbers start at 100 and end at 900. Line 100 has a label of SCREEN. Since this statement is an I/O Format statement, the label is a format label. Line 500 is an executable statement, labelled START, which is a statement label. Note that it refers to the format label used earlier in the program. The last statement shown is also an executable statement; it refers to the statement label used in the second statement shown.
Example 2:
Editor line number Label Statement ================================================================= 100 TOP: PRINT (0) (EN);(CS) 200 . 300 . 400 LOOP: 500 READ (1,CUSTFILE) EXCP=8000 600 PRINT (2,PRINTER) EXCP=9000 700 . 800 . 900 GOTO LOOPThis example demonstrates two approaches to using statement labels. On Comet editor line number 100, the label TOP: appears on the same line as an MTB statement. However, on editor line number 400, the label LOOP: appears by itself (without an MTB statement on the same line). Both methods are valid.