lang • break

BREAK

BREAK

Leave the current loop immediately. Opposite of CONTINUE.

Unlike other Basic dialects you do not need EXIT DO, EXIT FOR, EXIT LOOP, EXIT WHILE etc. in Gambas.

Example

Dim X As Integer

For X = 1 To 1000
  If X = 200 Then Break
  Print X
Next

See also