Flash Lite 1.x ActionScript Language Reference |
|
|
|
| Flash Lite Statements > continue | |||
Flash Lite 1.0.
continue
None.
Statement; jumps past all remaining statements in the innermost loop and starts the next iteration of the loop as if control had passed through to the end of the loop normally. It has no effect outside a loop.
while loop, continue causes the Flash interpreter to skip the rest of the loop body and jump to the top of the loop, where the condition is tested. do..while loop, continue causes the Flash interpreter to skip the rest of the loop body and jump to the bottom of the loop, where the condition is tested.for loop, continue causes the Flash interpreter to skip the rest of the loop body and jump to the evaluation of the for loop's post-expression.In the following while loop, continue causes Flash Lite to skip the rest of the loop body and jump to the top of the loop, where the condition is tested:
i = 0;
while (i < 10) {
if (i % 3 == 0) {
i++;
continue;
}
trace(i);
i++;
}
In the following do..while loop, continue causes Flash Lite to skip the rest of the loop body and jump to the bottom of the loop, where the condition is tested:
i = 0;
do {
if (i % 3 == 0) {
i++;
continue;
}
trace(i);
i++;
} while (i < 10);
In a for loop, continue causes Flash Lite to skip the rest of the loop body. In the following example, if i modulo 3 equals 0, the trace(i) statement is skipped:
for (i = 0; i < 10; i++) {
if (i % 3 == 0) {
continue;
}
trace(i);
}
|
|
|
|