BREAK statement

BREAK statement

Language reference ›› Statements ››
Parent Previous Next

Inside a WHILE, REPEAT, FOR or LOOP control statement, loop termination may be issued with the BREAK keyword:



 FOR I := 0 TO 10 DO
   BEGIN
     IF A = 0 THEN
       BREAK; // exit for loop
     // Code not executed if A=0
   END;


The BREAK statement is equivalent to a GOTO to the next instruction after the loop block.