pTAL Conversion Guide

Labels
pTAL Conversion Guide527302-002
7-2
Branching From a Subprocedure to Its Containing
Procedure
Branching From a Subprocedure to Its
Containing Procedure
TAL
If the target of a GOTO statement in a subprocedure is a label in the containing
procedure, the label in the containing procedure need not be declared in a LABEL
declaration.
pTAL
If the target of a GOTO statement in a subprocedure is a label in the containing
procedure, the label must be declared in a LABEL declaration in the containing
procedure. See GOTO Statement on page 15-12 for examples.
Labels and IF Statements
In pTAL, the conditional expression in an IF statement that is identified by a label
cannot test a hardware indicator:
For more information about using labels with IF statements, see Section 20, Hardware
Indicators.
Example 7-1. Labels and IF Statements (pTAL)
Invalid:
i := i + 1
label_a:
IF < THEN ... ! ERROR: Label cannot immediately precede
! IF statement that tests a hardware indicator
Valid:
INT i, j := 0;
i := i + 1;
IF < THEN ...