Comment embedded directives

Compiler directives can also be embedded within comments. For example:

!FTN95$OPTIONS(SILENT,CHECK)

or, in fixed format form:

CFTN95$OPTIONS(SILENT,CHECK)

The use of this form produces code that conforms to the ISO Fortran standard. The comment character (! or C) is followed by FTN95$ and then one of the following directives.

Directive

Purpose

OPTIONS

an alternative form for the OPTIONS(...) directive

WINAPP

an alternative form for the WINAPP directive, takes three arguments as described in the ClearWin+ documentation (Win32 only).

FREE

sets to free format (see note 1)

FIXED

sets to fixed format (see note 1)

RESTORE_FORMAT

restores the last source format (fixed or free) (see note 1)

INHIBIT_OPT

disables a list of optimisation numbers (like /INHIBIT_OPT) (see note 2)

ENABLE_OPT

restores a list of optimisations that have been inhibited by earlier use of INHIBIT_OPT (see note 2)

INHIBIT_CHECK

disables a list of checking options (like /INHIBIT_CHECK) (see note 2)

ENABLE_CHECK

restores a list of checking options that have been inhibited by an earlier use of INHIBIT_CHECK (see note 2)

SET_ERROR_LEVEL

same as the /SET_ERROR_LEVEL compiler option

LIBRARY

an alternative form for the LIBRARY directive

DEFINT_KIND

same as the /DEFINT_KIND compiler option

DEFREAL_KIND

same as the /DEFREAL_KIND compiler option

DEFLOG_KIND

same as the /DEFLOG_KIND compiler option

ATTRIBUTE

an alternative form for the .NET ATTRIBUTE command

ASSEMBLEY_EXTERNAL

an alternative form for the .NET ASSEMBLY_EXTERNAL command

ASSEMBLEY_INTERFACE

an alternative form for the .NET ASSEMBLY_INTERFACE command

STDCALL

an alternative to using F_STDCALL (not .NET); can be used before an EXTERNAL statement as well as before a SUBROUTINE or FUNCTION definition

DLLEXPORT

marks an external subprogram for export from a DLL (not .NET)

IGNORE

like /IGNORE but should be placed at the top of a file with a comma separated list of error numbers to ignore

 

Notes:

  • FIXED, FREE and RESTORE must not appear within a statement that is continued on the next line.

  • INHIBIT_OPT and ENABLE_OPT must appear immediately after the FUNCTION/SUBROUTINE/PROGRAM line of a subprogram and must not be used in a local subprogram (i.e. after a CONTAINS statement).

     

     

  • Basket
    Empty
     
    Copyright © 1999-2024 Silverfrost Limited