Specifications
Chapter 14. Statement Reference
334
Syntax:
Syntax 1:
REM $INCLUDE:’filename’
Syntax 2:
’$INCLUDE:’filename’
Description:
$INCLUDE reads a source program specified by ’filename’ into the program
line immediately following the
$INCLUDE line in compilation.
Storing definitions of variables, subroutines, user-defined functions, and other data
to be shared by source programs into the included files will promote application of
valuable program resources.
If this statement is placed at the beginning of source programs, then same user-
defined functions or subroutines may be shared by those source programs.
•
filename is a file to be included.
• If the specified filename does not exist in compiling a source program, a fatal error
occurs and the compilation terminates.
• No characters including space should be put between $ and INCLUDE and
between single quotes (') and
filename.
• As shown below, if any character except for space or tab codes is placed between
REM and $INCLUDE in syntax 1 or between a single quote (') and $INCLUDE in
syntax 2, the program line will be regarded as a comment line so that the
$INCLUDE statement will not execute.
REM xxx $INCLUDE:’mdlprg1.SRC’
• Before specifying included files, it is necessary to debug them carefully.
• $INCLUDE statements cannot be nested.
• The program lines in included files will not be outputted to the compile list.
If a compilation error occurs in an included file, the error message shows the line
number where the
$INCLUDE statement is described.
Symbols defined in included files will not be outputted to the symbol list.
• If a program line in an included file refers to a variable, user-defined function, or
others defined outside the included file, then the program line number where the
$INCLUDE statement is described will be outputted to the cross reference list, as
the referred-to line.
File I/O statement
$INCLUDE
Specifies an included file.