Statement - Exit from a loop statement
The EXIT statement indicates that the current loop (WHILE, REPEAT or FOR) must be finished. The execution continues after the END_WHILE, END_REPEAT or END_FOR keyword or the loop where the EXIT is. EXIT quits only one loop and cannot be used to exit at the same time several levels of nested loops.
Warning: loop instructions may lead to infinite loops that block the target cycle.
(* this program searches for the first non
null item of an array *)
iFound = -1; (* means: not found *)
FOR iPos := 0 TO (iArrayDim - 1) DO
IF iPos <> 0 THEN
iFound := iPos;
IF WHILE REPEAT FOR CASE