Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

EXIT-BLOCK Terminate processing of command block

&pagelevel(4)&pagelevel

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


0CMD0001No error

1CMD0202Syntax error

1SDP0118Command in false context

1SDP0223Incorrect environment

3CMD2203Incorrect syntax file

32CMD0221System error (internal error)

64SDP0091Semantic error

130SDP0099No 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.