FutureBasic Logo

<<    Index    >> FutureBasic

continue   statement



Syntax
continue

Description
The continue statement works only within a loop (such as for/next, do/until, while/wend) and is somewhat like the break statement. Instead of forcing loop termination like break, it skips the remainder of the current loop iteration and resumes the loop at the beginning (such as the while, for or do). The following example shows basic usage:

Example1

while ( x < 100 ) // the continue below branches here directly, does the conditional test and starts another loop iteration.
x++
if ( x == 25 ) then continue // skips the remainder of this loop iteration and resumes at the while's conditional test above
fn CallSomeThingElse
wend
fn DoSomeGoodWork

 

Example2
Note: inside nested loops, continue only affects the loop where it is used.

for i = 1 to 50 // the continue below has no impact on this outer for loop
while ( x < 100 )
x++
if ( x == 25 ) then continue // skips the remainder of this while loop iteration and resumes at the while's conditional test
fn CallSomeThingElse
wend
fn DoSomeGoodWork

next

See also
break; for; while; do; select case; exit [structure]