Including Other Programs

Two statements, $INCLUDE statement (synonyms are #INCLUDE and INCLUDE) and $CHAIN statement, instruct the compiler to include the source code of another program in the program currently being compiled. $INCLUDE inserts other code in your program during compilation, returning afterward to compile the next statement in your program $CHAIN also inserts the code of another program, but after doing so it does not continue reading from the original file. Any program statements following a $CHAIN statement are not compiled.

The syntax for both statements is as follows:

$INCLUDE [ filename ] program
$CHAIN [ filename ] program

If you do not specify filename, the included program must be in the same file as the program you are compiling.

If program is in a different file, you must specify filename in the $INCLUDE statement. filename must be defined in the VOC file.

The $INSERT statement is included for compatibility with Prime INFORMATION programs. $INSERT is used, like $INCLUDE, to insert other code in your program during compilation, returning afterward to compile the next statement in your program.

The syntax for the $INSERT statement is as follows:

$INSERT primos.pathname

The PRIMOS path name is converted to a valid filename using the following conversion rules:

Table 1. Conversion rules
Character Converts to Characters
/ converts to ?\
? converts to ??
An ASCII NUL converts to ?0
An initial . converts to ?.

Any leading *> is ignored. If a full path name is specified, the > between directory names changes to a / to yield the following:

[ pathname/ ] program

$INSERT uses the transformed argument directly as a filename of the file containing the source to be inserted. It does not use the VOC file.