The INCLUDE directive

It is possible to include source statements and compiler directives from another file by means of an INCLUDE directive which may appear anywhere in the current source file. This directive takes the form:

INCLUDE 'pathname'

where pathname is the name of a file containing Fortran source statements and compiler directives. If the pathname includes an extension then this must appear in the directive. For example:

   INCLUDE 'COLOURS.INS'

includes the given file from the current directory.

An alternative (non-standard) form of the INCLUDE directive is available, illustrated by the example:

   INCLUDE <COLOURS.INS>

which includes the given file from the INCLUDE sub-directory of the Silverfrost compiler directory.

Note that a source program may contain any number of INCLUDE directives each of which can, optionally, specify a different file. INCLUDE directives can be "nested" to a depth of 10. Thus one INCLUDEd file can itself contain other INCLUDE directives.

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited