LABEL
The LABEL
instruction declares a jump point that can be reached by a
GOTO
or WHENEVER … GOTO
.
Syntax
LABEL label-id:
- label-id is a unique identifier in a
MAIN
,REPORT
, orFUNCTION
program block. - The label-id must be followed by a colon (
:
).
Usage
The LABEL
instruction declares a statement label, making the next statement
one to which a GOTO
or WHENEVER … GOTO
statement can transfer
program control.
Example
MAIN
DISPLAY "Here 1"
GOTO label1
DISPLAY "Here 2"
LABEL label1:
DISPLAY "Here 3"
WHENEVER ANY ERROR GOTO label2
DISPLAY 1/0
DISPLAY "Here 4"
LABEL label2:
DISPLAY "Here 5"
END MAIN
Output:
Here 1
Here 3
Here 5