basic.include

Statement/BASIC Program, Releases: AP and R83

Includes object module within object module.

Syntax

{$}[include|insert] {file.reference} item-id

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.

Example

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
201,'customer'
007 equ last.name to customer.item(1)
008 equ first.name 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

See Also

Command Name Type Description
basic.statements Definition Definition of statements and functions.
basic.$include Statement Alternate method of 'include'.
basic.$insert Statement Inserts object module within object module.
basic.$insert$ Statement Alternate method of 'insert' (or 'include').

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.