Silverfrost Logo About Us | Contact Us

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:


includes the given file from the current directory.

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


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.



Copyright © 1999-2017 Silverfrost Limited