Home About Rice Downloads Documents Others Cooker CookerGX
Documents  >  Tutorial  >  continuestatement
continue statement

Purpose of this chapter.

We will learn about the continue statement.

The forced continuation of the loop statement.

The continue statement forcibly ends the current loop of the loop statement. And, it executes the next loop.

Statements after the continue statement will be ignored. The execution control will jump to the top of the nearest loop statement that surrounds it.

A continue statement is the following format.


continue ;

continue keyword

The 'continue' keyword indicates that this statement is a continue statement.

The end of the continue statement.

The end of the continue statement is represented by a semicolon.

The top of the loop statement.

The execution control returns to the top of the loop statement by continue statement, but its position will vary depending on the type of loop statement.

while statement.

If there is a while statement such as the following.


while ( conditional-expression )

statements...

continue;

statements...

endwhile


Conditional expression of the while statement will be evaluated every loop.

Therefore, the execution control that is returned by the continue statement will resume the loop from the evaluation of the conditional expression.

each statement.

If there is a each statement such as the following.


each ( collection-expression )

statements...

continue;

statements...

endeach


The collection-expression determines the collection that is the target of each statement. And, target of each statement is evaluated only once at the beginning of each statement.

Therefore, the execution control that is returned by the continue statement will resume the loop from the next statement of the collection-expression.

fromto statement.

If there is a fromto statement such as the following.


fromto ( start-index, end-index )

statements...

continue;

statements...

endfromto


The start-index and end-index determine the index of fromto statement. And, the index is evaluated only once at the beginning of fromto statement.

Therefore, the execution control that is returned by the continue statement will resume the loop from the next statement of the end-index.

Next
Previous
Copyright © Rice All rights reserved.