Tandy 1000 Basic Reference Manual page 110

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chawter
10 I
BASIC
Kevwords
CHAIN
Statement
CHAIN [MERGE] pathnume [,[,line] [,ALL]
[,DELETE
line-line]]
Lets the current program load and execute another program
named
pathname.
Pathname
is a standard file specification as defined in Chapter
1. It specifies the program you want
to chain. The program must
have been previously saved in ASCII format. See SAVE.
Line
is the line number or variable containing a line number
where BASIC begins execution in the chained program.
Line
is
always preceded by a comma (J. If you plan to use the ALL or
DELETE options and do not specify a line number, you must
specify a comma for
line.
This keeps BASIC from evaluating
ALL and DELETE as variables. If you omit
line,
BASIC begins
execution a t the first program line of the chained program.
The ALL option tells BASIC to pass every variable in the cur-
rent program to the chained program. If you omit ALL, the cur-
rent program must contain a COMMON statement t o pass
variables to the chained program.
If
chained programs chain
subsequent programs and pass variables, each new program
must contain either the ALL option or the COMMON statement.
The MERGE option overlays the lines of the chained program
with the current program. See the MERGE statement to under-
stand how BASIC overlays (merges) program lines.
The DELETE option deletes lines in the overlay so that you can
merge in a new overlay.
Ex
ample
s
C H A I N
" p r 0 9 2 "
loads
prog2,
chains it to the program currently in memory, and
begins executing it.
C H A I N
" s u b p r o g .
b a 5 " ,
, A L L
loads, chains and executes
subprog.bas.
The values of all the
variables in the current program are passed to
subprog.bas.
108

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents