Go to the first, previous, next, last section, table of contents.

EXIT Statement

EXIT

The EXIT statement must appear inside a WHILE, REPEAT, or LOOP statement. It causes the flow of execution to branch to the statement immediately following the innermost loop in which it appears. For example:

FOR x := 1 TO 5 DO
  i := 1;
  WHILE i < 3 DO
    i := i + 1;
    IF CheckIt(i, x) THEN
      EXIT  (* Transfers control to the IO.Put below *)
    END
  END; (* WHILE *)
  IO.Put("x = " & Fmt.Int(x) & "\n")
END; (* FOR *)


Go to the first, previous, next, last section, table of contents.