Home / lang / break 
BREAK
Syntax
BREAK

Leaves a loop immediately.

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

Examples

PUBLIC SUB Button1_Click()

  DIM X AS Integer

  FOR X = 1 TO 1000
    IF X = 200 THEN BREAK
    PRINT X
  NEXT

END

See also

Loop Control Structures