Domain: PROCEDURE
Command description
EXIT-BLOCK terminates processing of a command block (BEGIN, IF, WHILE, REPEAT block, etc.) and resumes procedure execution at the command following the block termination command. For a BEGIN-Block that was called with a INCLUDE-BLOCK command, execution of the procedure continues at the command that follows the INCLUDE-BLOCK command.
Execution of the EXIT-BLOCK command can be made to depend on a condition.
Notes
From dialog blocks, you can return only to the dialog level.
Expression replacement (&...) is not permissible for this command.
Format
EXIT-BLOCK |
BLOCK = *LAST / *ALL / <structured-name 1..255> ,CONDITION = *NONE / <text 1..1800 with-low bool-expr> |
Operands
BLOCK =
Designates the block to be terminated.
BLOCK = *LAST
Reference to the next higher block; this block is terminated.
BLOCK = *ALL
Processing of all surrounding blocks is terminated; from an interactive block, the system returns to the interactive level.
BLOCK = <structured-name 1..255>
Reference to the tag of the surrounding block to be terminated.
CONDITION =
Defines the condition for execution of the EXIT-BLOCK command.
CONDITION = *NONE
Command execution is not subject to any condition.
CONDITION = <text 1..1800 with-low bool-expr>
The EXIT-BLOCK command is not executed unless the specified Boolean expression is “TRUE”.
Command return codes
(SC2) | SC1 | Maincode | Meaning |
0 | CMD0001 | No error | |
1 | CMD0202 | Syntax error | |
1 | SDP0118 | Command in false context | |
1 | SDP0223 | Incorrect environment | |
3 | CMD2203 | Incorrect syntax file | |
32 | CMD0221 | System error (internal error) | |
64 | SDP0091 | Semantic error | |
130 | SDP0099 | No further address space available |
Example 1
/LOOP: WHILE (BED < 9) : : /IF (INP='*END') /WRITE-TEXT 'Processing stops' /EXIT-BLOCK LOOP /END-IF : : /END-WHILE /"Resume processing here after executing EXIT-BLOCK"
Example 2
/J=0 /FOR I=(’line 1’,’line 2’,’line 3’,’line 4) /J=J+1 /EXIT-BLOCK BLOCK=*LAST,CONDITION=(J>3) /SHOW-VARIABLE I /END-FOR
Output:
I = line 1 I = line 2 I = line 3
The fourth list element is not evaluated.