#INCLUDE statement

Syntax

#INCLUDE [filename] program
#INCLUDE program FROM filename

Description

Use the #INCLUDE statement to direct the compiler to insert the source code in the record program and compile it with the main program. The #INCLUDE statement differs from the $CHAIN statement in that the compiler returns to the main program and continues compiling with the statement following the #INCLUDE statement.

When program is specified without filename, program must be a record in the same file as the program containing the #INCLUDE statement.

If program is a record in a different file, the filename must be specified in the #INCLUDE statement, followed by the name of the program. The filename must specify a type 1 or type 19 file defined in the VOC file.

You can nest #INCLUDE statements.

The #INCLUDE statement is a synonym for the $INCLUDE and INCLUDE statements.

Example

PRINT "START"
#INCLUDE END
PRINT "FINISH"

When this program is compiled, the #INCLUDE statement inserts code from the program END (see the example on the END statement page). This is the program output:

START
THESE TWO LINES WILL PRINT ONLY
WHEN THE VALUE OF 'A' IS 'YES'.

THIS IS THE END OF THE PROGRAM
FINISH