Main Index : Reference :

continue


Description

Skips the current iteration of a do-while or for loop.

Usage

continue;

Program Structure

continue can be used within do-while or for loops. It exits the current iteration of the loop and jumps to the next iteration. Thus all statements in the loop that are after the continue statement are not executed.

Example

// Only even numbers are printed.

var i;

for (i=0; i<10; i++)
{
  if (i % 2 != 0) continue;
  println(i," must be an even number.");
}


// Skips any object whose name begins with "!".

var obj = doc->GetFirstObject();
if (!obj) return;

do
{
  if (strstr(obj->GetName(),"!") == 0)
    continue;
	
  // Do something with the object
  // (No !-objects ever come this far.)
}
while (obj = obj->GetNext());