Conditional compilation

The constants _WIN32 and _WIN64 are predefined for use with the FTN95 CIF directive. For example:

 CIF(_WIN64) 
  k = 64 
 CELSE 
  k = 32 
 CENDIF 
 print*, k

will print "64" if /64 (with /fpp) is used on the FTN95 command line.
This is particularly useful with CODE/EDOC blocks. In other contexts it is possible to use an equivalent run-time condition...

 IF(KIND(1_7) == 4)THEN
  k = 64 
 ELSE 
  k = 32 
 ENDIF 
 print*, k

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited