pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

Labels in Procedures
A label is the target location of a GOTO statement.
identifier
is as described in Identifiers (page 42). It cannot be an entry-point identifier.
The following guidelines apply:
LABEL is not a valid data type for a formal procedure parameter. You cannot pass a label to
a procedure.
A label is not a valid actual procedure parameter.
If a GOTO statement in a subprocedure branches to a label in the containing procedure, the
label must be declared in a LABEL declaration in the containing procedure, before the
subprocedure that contains the GOTO statement (see Nonlocal (page 215)).
NOTE: This is not recommended in pTAL because it is very inefficient.
The executable statement identified by a label cannot be an IF statement that tests the hardware
indicator.
The conditional expression in an IF statement that is identified by a label cannot test a hardware
indicator.
Example 222 IF Statements Identified by Labels
INT i, j := 0;
i := i + 1;
IF < THEN ... ! OK
i := i + 1
label_a:
IF < THEN ... ! ERROR: label cannot immediately precede an
! IF statement that tests a hardware indicator
Labels in Procedures 273