Continue

From Real Software Documentation

Jump to: navigation, search
Language Keyword

Continues execution with the next iteration of a loop.


Syntax

Continue
or
Continue [ For | While | Do ]
or
Continue For LoopVariable

Part Type Description
LoopVariable Datatype of a loop variable: Integer, Single, or Double The loop variable that controls iteration of the loop that you want to continue.

Notes

The Continue statement enables you to jump to the end of a loop and continue execution without executing the lines of code between the Continue statement and the end of the loop. If there is ambiguity concerning which loop you mean, you can use the second or third syntaxes to clarify the situation. For example, if you have nested For loops and want to jump from a line in the innermost loop to the outermost loop, you can use the last syntax to identify the loop variable that controls the outermost loop.


Examples

In the following example, the value of i is not written to the TextField when i=2 or 31 because execution jumps back to the For statement for those two values.

For i as Integer = 0 to 100
If i = 2 or i = 31 then
Continue
End if

TextField1.AppendText(Str(i))+EndOfLine
Next


See Also

Do, Exit, For, While statements.

Personal tools