The continue statement can be used to skip to the next iteration of a loop. The following (rather trivial) example illustrates the use of the continue statement to assign even numbers to an indexed local (Process) variable.
var i = 0, j = 0
for (j=0; j < 102; j++)
{
if (j%2) continue
// following statement executed only for even values of j
Process.evens[i] = j
i++
// following stops the loop when all elements of array are completed
if (i >= Process.evens.Size) break
}
|
Copyright © 2014 CA.
All rights reserved.
|
|