AMT Help Files

BREAK (BK)

Syntax

Command
Mandatory parameter
Optional parameter
Mandatory keyword
Optional keyword

BREAK [OUTMOST]

Diagram

Description

Terminates execution of the current loop and continues with the first line of code after the loop.
In the example below after the first BREAK code execution will continue at LOOP FOR, and after the BREAK OUTMOST it will continue after the second ENDLOOP.

Returned value type

None

Parameters

Parameter Description
OUTMOST Terminates execution of all current nested loops and continues with the first line of code after the outermost loop.

Remarks

Break will break out of any loop including READFILE loops, etc.

Example


loop for sn-vert := 1 to screen.occursvert
    if screen[1sn-vert] = '' then bk
    loop for sn-horz := 1 to screen.occurshorz
        if screen[sn-horzsn-vert] = '' then bk outmost
        if not screen[sn-horzsn-vertin ['''I''C''A''D']
            smex ('Only I/C/A/D or empty',, screen[sn-horzsn-vert])
        endif
    endloop
endloop

 

Return to

Commands