break loop, continue loop

Prev Next

Function Names

break loop, continue loop

Description

break loop skips the remaining code till loop end, stops the loop and continues with next statements after the loop.
continue loop skips the remaining code till loop end and continues with the next loop round, provided the loop condition is met.

Call as: procedure

Restrictions

Indirect parameter passing is disabled

Parameter count

0

Examples


       echo("Break and continue loops");
               for (a[] = 1, a[] <= 4, a[]++)
               {
                       echo("  Loop begin ", a[] );
                       if (a[] = 2) continue loop;
                       if (a[] = 3) break loop;
                       echo("  Loop end ", a[] );
               }

Output

Break and continue loops
  Loop begin 1
  Loop end 1
  Loop begin 2
  Loop begin 3
Try it yourself: Open LIB_Function_break_loop.b4p in B4P_Examples.zip. Decompress before use.

See also

break
continue