Insert 'include file'
$include "pathname"
$include FROM infoboxpath
This command is used to allow a principal infobox script file to include the contents of another script file, which is treated as if the commands were in the principal infobox when it is being processed. Attempts to nest include files will be ignored, but a principal infobox can include multiple different files, or the same file multiple times.
The command is used in two ways. First, in the principal file, to specify the file to be included. And second, in the included file, to specify the script infoboxes which are permitted to include this file. The second usage is optional unless the calling file or the included file contains encrypted variables.
Commands in the principal infobox
In the original file, the parameter on this command is used as follows:
| pathname | The full pathname of the file whose contents are to be used. |
The pathname must be available on each CopiaFacts node which will process the infobox. If the COLLECT program is used to build an IBC file containing the infobox, the pathname must also be available on the machine where COLLECT is run. The include file is embedded in the IBC and changes to the include file on disk will not be seen when the calling IIF is run from an IBC file.
This command must not be used in a $type menu infobox, nor can the file included contain $menu_item commands. The file extension for an included file need not be .IIF, but using this extension makes it easier to edit the file in COPIAEDIT, and is recommended.
Commands in the included infobox
In the included file, the parameters on this command are used as follows:
| FROM | A required keyword when the command is used inside an included file |
| infoboxpath | The pathname of an infobox file relative to the FAXFACTS folder, without an IIF extension. |
The command(s), if used, must be at the start of the file, before any command lines other than blank lines and comments.
If none of these commands appear in the included file, no check will be made on the caller infobox. However this will prevent the authentication of encrypted variables in the included file.
When any of these commands appear in an included file, an attempt to include the file from an infobox not matching one of these commands will fail with a run-time error.
When encrypted variables have been used in an included file, the file can be opened in COPIAEDIT to apply or re-apply an $authenticate command in all the infoboxes which include the file. COPIAEDIT uses this command with a FROM keyword to locate each calling file. A principal file can also be opened in COPIAEDIT for authentication individually, and will use the included file, provided that it names the principal file on one of these commands, as part of the authentication process. An $authenticate command in an included file will prevent the include operation.
Examples:
To include common.IIF from another file:
$include "@FFBASE\scripts\common.iif"
To reference principal file(s) which include this file:
$include FROM SCRIPTS\GW_SECURE_NOTIFY
$include FROM SCRIPTS\GW_NOTIFY