HP 3000 Manuals

INCLUDE [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation


HP Pascal/iX Reference Manual

INCLUDE 

INCLUDE is a System-Dependent MPE/iX and HP-UX Option.

The INCLUDE compiler option includes text from a specified file in the
source code being compiled.

Syntax 

     $INCLUDE string_literal$

Parameter 

string_literalSpecifies the name of the file to be included at the
              current position in the program.  The file specification
              depends upon the operating system.

Default       None.

Location      Anywhere.

The file that contains the INCLUDE option is the including file, and the
file specified by string_literal is the included file.

When the compiler encounters the INCLUDE option, it processes text from
the included file, as if the text were part of the including file.  When
the included file ends, the compiler continues processing the including
file, resuming with the line that follows the INCLUDE option; therefore,
ignoring options and source code that follow INCLUDE on the same line).

An included file can contain an INCLUDE option; that is, included files
can be nested.  The maximum nesting level is the maximum number of files
that the operating system allows to be open simultaneously.

On the HP-UX operating system, if the file to be included cannot be found
or opened, and its name is not an absolute path name (that is, it does
not start with the character "/"), then the compiler looks for the file
in the following places (this is called the search path).

   *   The directory that contains the .p file being compiled (the main
       source file).

   *   The current working directory.

   *   The directory /usr/include.

If the file still cannot be found or opened, the compiler issues an error
message and the compile aborts.


NOTE The pc option +C on HP-UX affects the INCLUDE compiler option (see the HP Pascal/HP-UX Programmer's Guide).
Example 1 This example applies only to HP-UX. PROGRAM show_include; VAR $INCLUDE '/users/pascal/prog1/global'$ BEGIN i := 3; j := 1.55; END. If the file /users/pascal/prog1/global is: i : INTEGER; j : REAL; Then the preceding program is equivalent to: PROGRAM show_include; VAR i : INTEGER; j : REAL; BEGIN i := 3; j := 1.55; END. Example 2 This example applies only to MPE/iX. PROGRAM show_include; VAR $INCLUDE 'global.prog1.pascal'$ BEGIN i := 3; j := 1.55; END. If the file global.prog1.pascal is: i : INTEGER; j : REAL; Then the preceding program is equivalent to: PROGRAM show_include; VAR i : INTEGER; j : REAL; BEGIN i := 3; j := 1.55; END.


MPE/iX 5.0 Documentation