forlang.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
$ELSEIF
                                             Up Contents Index Back
─────$ELSEIF────────────────────────────────────────────────────────────────
 
     Action
 
     Causes compilation of a block of statements if <expression> is
     .TRUE. and the matching $IF metacommand is .FALSE.
 
     Syntax  $ELSEIF (expression)
 
     Parameter          Description
 
     expression         A logical expression
 
     Remarks
 
     The logical expression in a $ELSEIF metacommand can take two
     forms. One is the conditional-compilation operator DEFINED,
     followed by a symbol name in parentheses.
 
     The second form is a logical comparison, where the value of the
     symbol is compared with an integer constant or the value of
     another symbol.
 
     Example
 
     $DEFINE flag
     $DEFINE testval = 3
 
     $IF (.NOT. DEFINED (flag))
           WRITE (*, '('' Compiled if flag not DEFINED'')')
     $ELSEIF (testval .GT. 3)
           WRITE (*, '('' Compiled if flag DEFINED .AND. testval
          +.GT. 3'')')
     $ELSE
           WRITE (*, '('' Compiled if flag DEFINED .AND. testval
          +.LE. 3'')')
     $ENDIF
     $ENDIF
                                    -♦-