AMT Help Files

BREAK (BK)

Syntax Color Legend
Command
Mandatory parameter
Optional parameter
Mandatory keyword
Optional keyword

Syntax

BREAK [OUTMOST]

Diagram

Description

Terminates the 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 continues at LOOP FOR. After BREAK OUTMOST, it continues 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[1, sn-vert] = '' then bk
  loop for sn-horz := 1 to screen.occurshorz
    if screen[sn-horz, sn-vert] = '' then bk outmost
    if not screen[sn-horz, sn-vert] in ['', 'I', 'C', 'A', 'D']
      smex ('Only I/C/A/D allowed!',, screen[sn-horz, sn-vert])
    endif
  endloop
endloop

Return to

Commands

Contents