Electron microscopy
 
Comparison between FOR and WHILE statements
- Practical Electron Microscopy and Database -
- An Online Book -
Microanalysis | EM Book                                                                                   http://www.globalsino.com/EM/        


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

 

In many cases, WHILE statement can be replaced by FOR statements. Table 1140 shows examples in which both the FOR and WHILE statements are equivalent.

Table 1140. FOR and WHILE statements which are equivalent.

Examples FOR statement WHILE statement
Format FOR statement:
         for (Statement1; Expression; Statement2 )
         Statement3
Statement1
         while ( Expression )
         {
             Statement3
             Statement2
         }
Script example FOR script WHILE script

 

 

 

 

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