forlang.hlp (Table of Contents; Topic list)
$IF
                                             Up Contents Index Back
─────$IF────────────────────────────────────────────────────────────────────
 
     Action
 
     Conditionally compiles a statement block if an expression is .TRUE.
     If the <expression> is .FALSE., control is transferred to the next
     $ELSE, $ELSEIF, or $ENDIF metacommand at the same $IF level.
 
     Syntax $IF expression
 
     Parameter          Description
 
     expression         A logical expression
 
     Remarks
 
     The logical <expression> in a $IF metacommand can take two forms.
 
        ■ The conditional compilation operator DEFINED, followed by a
          symbol name in parentheses.
 
        ■ 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 DEFINED (flag)
           WRITE (*, '('' This is compiled if flag DEFINED'')')
     $ENDIF
     .
     .
     .
     $IF (testval .LT. 1) .AND. .NOT. DEFINED (flag)
           WRITE (*, '('' Testval .LT. 1 .AND. flag .NOT. DEFINED'')')
     $ELSE
           WRITE (*, '('' Testval .GE. 1 .OR.  flag       DEFINED'')')
     $ENDIF
                                    -♦-