LABEL
9.5B
The LABEL data definition declares an program execution label pointer that can be changed when a PLB program is executing. Program Control instructions can use the [label] name reference for the LABEL variable in place of normal Program Execution Label references. The statement uses one of the following formats:
|
|
|
|
Where:
label
Required. A Data Definition Label.
^
Required. Identifies the label as a pointer.
@
Optional. Identifies the label as a global pointer.
Flags Affected: NONE
Note the following:
The LABEL variable is a pointer that can be assigned to the address of a Program Execution label reference.
See the descriptions for the following instructions regarding the use/manipulation of the LABEL variable: CLEARLABEL, GETLABEL, LOADLABEL, MOVELABEL, MOVELV, MOVEVL, STORELABEL, TESTLABEL, and VERB (User defined verb).
The following Program Control Instructions can use the LABEL variable: BRANCH, BRANCHF, CALL, GOTO, PERFORM, PERFORMF, EXCEPTSET and TRAP.
The LABEL variable cannot be used in an EVENTREGISTER instruction. In this case, a compiler error occurs.
The LABEL variable cannot be declared as a Common or Global variable.
The label name reference for a LABEL pointer is mapped into the Program Execution labels. The LABEL pointer cannot be specified in a CALL USING variable list or a LROUTINE, ROUTINE, or PROCEDURE parameter variable list.
An execution LABEL pointer can not be declared within the scope of a LFUNCTION/FUNCTIONEND or FUNCTION/FUNCTIONEND.
When normal program flow control instructions are being used, an execution LABEL
pointer can be passed as a parameter using a typeless VAR
variable:
Example:
VAR1 VAR ^
.
DISPLAY "Pass Execution Program label
as parameter!"
MOVELV ProgLabel, VAR1
CALL ExeLabel USING VAR1
KEYIN "Hit enter to exit...:",S$CMDLIN
SHUTDOWN
.
LABx LABEL ^
VARx VAR ^
ExeLabel ROUTINE VARx
.
MOVEVL VARx, LABx
CALL LABx
RETURN
.
ProgLabel
DISPLAY "ProgLabel is doing something!"
RETURN
See Also: Data Definitions
![]() |