PERFORMF
The PERFORMF instruction initiates a subroutine, based upon a Function Flag (Function key entry). When the instruction is executed, the address of the next sequential instruction is placed in the top element of the subroutine call stack. The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
targets
Required. A list of Program Execution Labels, EXTERNALs, or LABELs from which a new program address is selected.
Flags Affected: Function Key
Note the following:
Each Program Execution Label in {labels} corresponds (sequentially) to a Function Flag (i.e., the first label is taken if F1 is pressed, the second label if F2, the third label if F3, etc.).
The Function Flag is reset if the PERFORMF is taken.
There is a limit of forty (40) Program Execution Labels that may be referenced, since the compiler supports a maximum of forty (40) Function keys.
Additional lines may be used for the list by ending each continued line with a colon (:).
All other rules pertaining to PERFORM apply.
Example 1:
|
|
|
|
|
|
|
|
If Function Flag F1 (Function key 1) were set due to it being pressed during a KEYIN, the subroutine designated by the Program Execution Label FKEY1 would be initiated. If Function key 2 had been pressed, the subroutine designated by FKEY2 would be initiated. If F3 were set, FKEY3 would be initiated and so on. Entering a Function key number without a corresponding Program Execution Label causes the program to fall through the PERFORMF routine to the next sequential instruction.
Example 2:
|
|
|
|
If Function Flag F1 (Function key 1) were set due to it being pressed during a KEYIN, the subroutine designated by the Program Execution Label FKEY1 would be initiated. If Function key 5 had been pressed, the subroutine designated by FKEY2 would be initiated. Entering a Function key number without a corresponding Program Execution Label causes the program to fall through the PERFORMF routine to the next sequential instruction.
See Also: PERFORM, Program Control Instructions
![]() |