SecondBASIC Documentation v3

Home / Command Reference / Continue

Continue

Description: Interrupts the normal execution of a loop. Any statements after the Continue command will be skipped and the next iteration of the loop will begin.

Syntax:

Continue <loop>

Part Description
<loop> Required. This is type of loop you're in that you want to jump to the next iteration. Valid <loop> values are For, While, Do, and Loop. Both Do and Loop are identical.

Notes: Be careful when using Continue in both Do...Loop and While...Wend loops as you can easily create an infinite loop.

Example:

        a = 1
        Do While a < 10
                a++
                If a > 3 Then Continue Do
                Print a
        Loop
 
        a = 1
        While a < 10
                a++
                If a > 3 Then Continue While
                Print a
        Wend
 
        For a = 1 To 10
                If a > 3 Then Continue For
                Print a
        Next