INCLUDE - F77 "include" statement and search rules.

Usage:

INCLUDE "fid-str" [,options]*
   or
INCLUDE : fid-param [,options]*

Where:

"fid-str"
is a string constant (enclosed in quotes) that gives the "fid" to be included. (See "fid" below.)
fid-param
is a parameter symbol defined to be a character constant. This gives the "fid" to be included. If you use this format of the INCLUDE statement, the keyword INCLUDE must be followed by a ":".
"fid"
is a character constant. This is a 1 to 32 character name with no slashes. It can be a full GCOS pathname including the UMC, or it can be resolved through the search fules. Relative pathnames are not acceptable.

Examples:

include "myumc/common"
include "debugcode",multiple
parameter (fid="yyy")
include : fid

Options:

LIST
If a source listing is being produced (as controlled by the usual listing options), this will list the included source text. This is the default action.
NOLIST
Does not list the included source text.
UNIQUE
Includes the specified "fid" only if it has not already been included in this compilation unit (main program, or subprogram). Subsequent requests to include this name will be ignored. This is the default action.
MULTIPLE
Includes text even if it has already been included.

Description:

The Fortran 77 compiler supports a source "include" facility. The INCLUDE statement either directly names a GCOS file to be included, or gives a name (fid) which is resolved according to a set of search rules.

Search rules:

If the "fid" does not contain any slashes, the text to be included is found by a search process involving a set of "search rules". In batch, a search rule is specified as a record in file code SR. In TSS, a search rule is specified with the Search= option of the F77 command. Search rules are processed in the order given until a match for the name is found. If no match is found, the compiler will give an appropriate error message.

There are three possibilities for a search rule. It can be a full GCOS pathname of a sequential file, where the final element (i.e. the filename under the last subcatalog) matches the include name (fid) we are looking for. It can be a full pathname of a source library file (SRCLIB) whose members are to be considered candidates for inclusion. Finally, it can be a catalog pathname with a trailing slash (e.g. "myuser/includes/"), where the sequential files under that catalog are candidates for inclusion.

Notes:

When sequential files are included (i.e. when the text does not come from a SRCLIB library), they must be the same format as the file including them. In other words, both must be ASCII or both BCD. Similarly, attributes such as line numbering and formatting must match. The usual practice of keeping all source files as ASCII files with proper Fortran formatting will save many headaches. If you are compiling in batch, refer to your source with a $PRMFL card instead of a $$SELECT.

INCLUDE statements are NOT part of the ANSI standard for Fortran-77. They are, however, part of a set of extentions defined by a U.S. military standard (MIL-STD-1753), and so will be found in Fortran compilers from most of the major manufacturers. Naturally, absolute pathnames are NOT portable. The Unix 4.2 BSD compiler does NOT support options on the INCLUDE statement.

Included text may contain at most one subprogram. If it contains an END statement, it must be the last line of the included text.

Copyright © 1996, Thinkage Ltd.