pTAL Reference Manual (H06.03+)

Procedures, Subprocedures, and Procedure
Pointers
HP pTAL Reference Manual523746-005
14-37
Labels in Procedures
Labels in Procedures
A label is the target location of a GOTO statement.
identifier
is as described in Identifiers on page 2-8. 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 on page 12-24).
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.
Note. This is not recommended in pTAL because it is very inefficient.
Example 14-21. 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
,
;
VST196.vsd
identifierLABEL