next up previous contents
Next: Conditional Exit Loops Up: Control Flow Previous: IF Construct

Nested and Named IF Constructs

All control constructs can be both named and nested.

    outa: IF (a .NE. 0) THEN
     x = b/a
     inna1: IF (c .NE. 0) THEN
      y = d/c
     ELSE inna1
      y = -99
     ENDIF inna1   
    ELSEIF (a .GT. 0) THEN outa
     ...
    ELSE outa
     ...
    ENDIF outa

The names may only be used once per program unit and are only intended to make the code clearer.

For more information, click here gif

Now try this question gif


next up previous contents
Next: Conditional Exit Loops Up: Control Flow Previous: IF Construct

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 18:56:08 GMT 1996
Not for commercial use.