Introduction | Language Structure | IB Statements | File System | Comet 32 Runtime | Index |
| Syntax: | INCLUDE include-filename [,directory-name] [,starting-edit-line-number] |
| Discussion: |
The INCLUDE statement is a compiler directive. As such, it causes an action
to occur when the program is compiled, not when the program is executed.
The INCLUDE directive can appear anywhere in an Internet Basic source program.
The include-filename parameter is the name of the Internet Basic include file to be merged. This name must be enclosed in matching quotation marks (single or double). The include file may be a text file or Comet Editor (CED) file. The directory-name parameter (optional) represents the name of the Comet directory where the include file is stored.
The statements in the include file will be merged into the program section where the INCLUDE directive appears. Therefore, the include file must contain the same kind of statements (e.g., Data Division, I/O Format Division, or Procedure Division) as the section of the program where the INCLUDE directive appears. Include files may be nested to two levels. This means that an include file may contain another INCLUDE directive. In this case, the secondary level program lines will be merged into the primary include file, and those lines will be merged into the main object program. |
| History: | The INCLUDE statement was added to the language in Build 292 as a synonym for the USE directive. |
| Example: |
The following example shows a main program that merges a single
include file into the resulting object program at compile time. The
include file is a text file named "CUST."
Main program Include file named "CUST.INC" |