Electron microscopy
 
CONTINUE Statement in DM
- Practical Electron Microscopy and Database -
- An Online Book -
Microanalysis | EM Book                                                                                   http://www.globalsino.com/EM/        


=================================================================================

 

In program execution, it is possible to force an early iteration of a loop, bypassing the loop’s normal control structure. This is performed by using CONTINUE statement. This statement forces the next iteration of the loop to take place by skipping any code between itself and the conditional expression which controls the loop. Table 1132 shows examples with CONTINUE statements.

Table 1132. Examples with CONTINUE statements.

Script Function
number EMx;
for(EMx=0; EMx<=50; EMx++)
{
if(EMx % 2)
continue
result (EMx + "\n")
}
Script code
Prints the even numbers between 0 and 50. The odd ones will cause the loop to iterate early, bypassing the cout statement
number x = 25
while ( 1 )
{
if ( !GetNumber( "Enter a number from 10 to 25", x, x ) )
exit( 0 )
if ( x < 10 || x > 25 )
{
OkDialog( "Out of range" )
continue // A continue statement.
}
result( x + "\n" )
}
Script code
Determine whether or not an entered number is in a specific range

 

 

 

=================================================================================