Was this helpful?
Include File Processing
The EQUEL include statement provides a means to include external files in your program's source code. Its syntax is:
## include filename
Filename is a quoted string constant specifying a file name, a system environment variable (UNIX and Windows) or logical name (VMS) that points to the file name. If no extension is given to the filename (or to the file name pointed at by the environment variable (UNIX and Windows) or defined as logical (VMS), the default Fortran input file extension ".qf" is assumed.
This statement is normally used to include variable declarations, although it is not restricted to such use. For more details on the include statement, see the QUEL Reference Guide.
UNIX: The included file is preprocessed and an output file with the same name, but with the default output extension ".fish generated. You can override this default output extension with the -o.ext flag on the command line. The reference in the original source file to the included file is translated in the output file to the specified include output file. If you use the -o flag with no extension, no output file is generated for the include file.
If you use both the -o.ext and the -o flags, then the preprocessor generates the specified extension for the translated include statements in the program. However, it does not generate new output files for the statements.
For example, assume that no overriding output extension was explicitly given on the command line. The EQUEL statement:
## include "employee.qf"
is preprocessed to the Fortran statement:
include 'employee.f'
and the file "employee.qf" is translated into the Fortran file "employee.f."
As another example, assume that a source file called "inputfile" contains the following include statement:
## INCLUDE "MYDECLS";
The name "MYDECLS" can be defined as a system environment variable pointing to the file "/dev/headers/myvars.qf" by means of the following command at the system level:
setenv MYDECLS "/dev/headers/myvars"
Assume now that "inputfile" is preprocessed with the command:
esqlf -o.h inputfile
The command line specifies ".h" as the output file extension for include files. As the file is preprocessed, the include statement shown earlier is translated into the Fortran statement:
include '/dev/headers/myvars.h'
and the Fortran file "/dev/headers/myvars.h" is generated as output for the original include file, "/dev/headers/myvars.qf".
You can also specify include files with a relative path. For example, if you preprocess the file "/dev/mysource/myfile.qf," the EQUEL statement:
## include "../headers/myvars.qf"
is preprocessed to the Fortran statement:
include '../headers/myvars.f'
and the Fortran file "/dev/headers/myvars.f" is generated as output for the original include file, "/dev/headers/myvars.qf". This statement is normally used to include variable declarations, although it is not restricted to such use. For more details on the include statement, see the QUEL Reference Guide
VMS: If you specify a different extension with the -n flag of the eqf statement, then you must also specify filename with that extension.
The included file is preprocessed and an output file with the same name but with the default output extension ".for" is generated. You can override this default output extension with the -o.ext flag on the command line. The reference in the original source file to the included file is translated in the output file to the specified include output file. If you use the -o flag without an extension, no output file is generated for the include file. This is useful for program libraries that are using VMS MMS or MAKE dependencies.
If you use both the -o.ext and the -o flags, then the preprocessor generates the specified extension for the translated include statements in the program but does not generate new output files for the statements.
For example, assume that no overriding output extension was explicitly given on the command line. The EQUEL statement:
## include "employee.qf"
is preprocessed to the Fortran statement:
include 'employee.for'
and the employee.qf file is translated into the Fortran file "employee.for."
As another example, assume that a source file called "inputfile" contains the include statement shown below.
## include "mydecls"
The name "mydecls" is defined as a system logical name pointing to the file "dra1:[headers]myvars.qf" by means of the following command at the DCL level:
$ define mydecls dra1:[headers]myvars.qf
Assume now that "inputfile" is preprocessed with the command:
$ eqf -o.h inputfile
The command line specifies ".h" as the output file extension for include files. As the file is preprocessed, the include statement shown earlier is translated into the Fortran statement:
include 'dra1:[headers]myvars.h'
and the Fortran file "dra1:[headers]myvars.h" is generated as output for the original include file, "dra1:[headers]myvars.qf."
You can also specify include files with a relative path. For example, if you preprocess the file "dra1:[mysource]myfile.qf," the EQUEL statement:
## include "[-.headers]myvars.qf"
is preprocessed to the Fortran statement:
# include '[-.headers]myvars.for'
and the Fortran file "dra1:[headers]myvars.for" is generated as output for the original include file, "dra1:[headers]myvars.qf."  
Windows: If you specify a different extension with the -n flag of the eqf statement, then you must also specify filename with that extension.
The included file is preprocessed and an output file with the same name but with the default output extension ".for" is generated. You can override this default output extension with the -o.ext flag on the command line. The reference in the original source file to the included file is translated in the output file to the specified include output file. If you use the -o flag without an extension, no output file is generated for the include file.
If you use both the -o.ext and the -o flags, then the preprocessor generates the specified extension for the translated include statements in the program but does not generate new output files for the statements.
For example, assume that no overriding output extension was explicitly given on the command line. The EQUEL statement:
## include "employee.qf"
is preprocessed to the Fortran statement:
include 'employee.for'
and the employee.qf file is translated into the Fortran file "employee.for."
As another example, assume that a source file called "inputfile" contains the include statement shown below.
## include "mydecls"
The name "mydecls" is defined as a system environment name pointing to the file "c:\headers\myvars.qf" by means of the following command at the command prompt:
set mydecls=c:\headers\myvars.qf
Assume now that "inputfile" is preprocessed with the command:
$ eqf -o.h inputfile
The command line specifies ".h" as the output file extension for include files. As the file is preprocessed, the include statement shown earlier is translated into the Fortran statement:
include 'c:\headers\myvars.h'
and the Fortran file "c:\headers\myvars.h" is generated as output for the original include file, "c:\headers\myvars.qf."
You can also specify include files with a relative path. For example, if you preprocess the file "c:\mysource\myfile.qf," the EQUEL statement:
## include "..\headers\myvars.qf"
is preprocessed to the Fortran statement:
# include '..\headers\myvars.for'
and the Fortran file "c:\headers\myvars.for" is generated as output for the original include file, "c:\headers\myvars.qf."  
Last modified date: 08/28/2024