basic.include Statement/BASIC Program


Command basic.include Statement/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
Description folds in Pick/BASIC code from a separate item to be compiled as part of the object module of the current program or subroutine. The original source program is not altered.

The "include" statement is typically used to include "common" or "equate" statements, format strings, and executable statements from a single source into several programs.

When the Pick/BASIC compiler encounters an "include" statement, it opens the file specified by "file.reference", reads the item, and compiles it into the current program.

When the file.reference is omitted, the current file is assumed.

There is no limit to the number of "includes" in a program, but only five levels of nesting are allowed.

The $ is optional.
Syntax {$}[include|insert] {file.reference} item-id
bp standard.equates
001 equ stx to char(1)
002 equ form.feed to char(12)
003 equ bell to char(7)
004 equ am to char(254), vm to char(253), svm to char(252)
005 dim customer.item(25)
006 open 'customer' to customer.file else stop 
007 equ to customer.item(1)
008 equ to customer.item(2)
009 equ title to customer.item(3)

bp prog
001 include standard.equates
002 read item1 from customer.file,"01234" else print bell
Related basic.statements