Break (Reserved Word)

image\trumpet2.gif Disclaimer

The Break reserved word terminates the execution of the nearest enclosing loop in which it appears.  Control passes to the statement that follows the terminated statement, if any.

Syntax

Break;

Remarks

When used in a conditional Switch statement, Break causes EasyLanguage to execute the next statement after the switch 'end'.  

In loops (for-loop, while-loop, or repeat/until), Break terminates execution of the loop containing the Break statement, with control passing to the next EasyLanguage statement after the loop.  Within nested statements, Break terminates only the loop that immediately encloses it.

Example

In the following example, the For loop will exit after printing values of 1 through 4.

For i = 0 to 9

  Begin
    Print(i);
    If (i=4) then Break;
  End;