INCLUDE Statement
Specifies that a large or commonly used section of code that is stored outside the source code item should be included when the code module is compiled.
Note
INCLUDE cannot be used with old source compacted programs.
Syntax
{$}INCLUDE item-name {FROM file-specifier}
{$}INCLUDE file-specifier item-name
Syntax elements
$ is an optional character that can be used for compatibility with other MultiValue systems.
item-name is the name of the item to be included.
file-specifier specifies the file containing the item.
If file-specifier is omitted, item-name is retrieved from the file containing the item being processed.
Operation
INCLUDE can be used anywhere within a DataBasic program as often as desired, so the source code can expand to any size. INCLUDE must be the only statement on the line.
A source program item can contain any number of INCLUDE statements. INCLUDE statements can be nested to a maximum of 16 levels.
When you compile a program containing INCLUDE statements, an initial pass is made on the source item to merge in the included items. Because the compiler processes only the resulting program, any line number references will be different from the attribute numbers in the actual item(s). To obtain the correct line numbers, use the 'L' option when compiling the program or use BLIST with the 'M' and 'E' options.
See also
Including Common Code, $CHAIN statement.
Examples
INCLUDE ITEMA
Includes the item called ITEMA, found in the same file as the current program.
INCLUDE ITEM1 FROM TESTFILE,SECT1
INCLUDE TESTFILE,SECT1 ITEM1
Both these examples include ITEM1, found in the data section SECT1 of file TESTFILE.