OWBasic for Pocketviewer

Home INTRO Group CONTROL Alphabetical Index

Loop control

BREAK
CONTINUE
IF <boolean expression> BREAK
IF <boolean expression> CONTINUE

BREAK leaves the current loop.
CONTINUE jumps to the next pass.
BREAK and CONTINUE are implemented for FOR..NEXT, WHILE..WEND and DO..LOOP loops.
Example:

n=0
FOR i=0 TO 100
 IF i=50 CONTINUE
 INC n,rnd(i)
 IF n>=800 BREAK
NEXT
PRINT n

Home INTRO Group CONTROL Alphabetical Index