XL Fortran for AIX 8.1

Language Reference


DO WHILE Construct

The DO WHILE construct specifies the repeated execution of a statement block for as long as the scalar logical expression specified in the DO WHILE statement is true. You can curtail a specific iteration with the CYCLE statement, and the EXIT statement terminates the loop.



>>-DO_WHILE_statement------------------------------------------><
 
 
>>-statement_block---------------------------------------------><
 
 
>>-+-END_DO_statement---+--------------------------------------><
   '-terminal_statement-'
 
 

DO_WHILE_statement
See DO WHILE for syntax details

END_DO_statement
See END (Construct) for syntax details

terminal_stmt
is a statement that terminates the DO WHILE construct. See The Terminal Statement for details.

The rules discussed earlier concerning DO construct names and ranges, active and inactive DO constructs, and terminal statements also apply to the DO WHILE construct.

Example

I=10
TWO_DIGIT: DO WHILE ((I.GE.10).AND.(I.LE.99))
  J=J+I
  READ (5,*) I
END DO TWO_DIGIT
END


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]