Radio Shack TRS-80 Trsdos & Disk Basic Reference Manual page 116

Micro computer system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

DISK BASIC
MERGE
provides
a
convenient
means
of putting
modular programs
together.
For
example, an
often-used
set
of
BASIC
subroutines can
be tacked onto
a variety
of programs with
this
command.
For
example, suppose
the following
program
is
in
RAM:
16
REM.
.
.
MAIN PROGRAM
26 GOSUB 1000
30
REM.
.
.
MORE PROGRRM LINES HERE
399 END
1000
REM.
.
.
NEED TO RDD SUBROUTINES HERE
1010
REM.
.
.
SO USE MERGE COMMAND
1020 PRINT"SUBROUTINE NOT AVAILABLE"
:
RETURN
And
suppose
the following
program
is
stored
on
disk
in
ASCII
format:
1000
REM.
.
.
BEGINNING
OF
SUBROUTINE
1010 PRINT"EXECUTING
SUBROUTINE.
.
.
"
1020
REM.
.
.
MORE PROGRAM LINES HERE
1100 RETURN
Assuming
the subroutine
program
is
named
SUB
/TXT,
then
we
could
MERGE
it
with
the statement:
MERGE"SUB/fXT"
and
the resultant
program
in
RAM
would
be:
10
REM.
.
.
MAIN PROGRAM
20 GOSUB 1000
30
REM.
.
.
MORE PROGRAM LINES HERE
999 END
1000
REM.
.
.
BEGINNING
OF
SUBROUTINE
1010
PRINT-'EXECUTING SUBROUTINE.
.
.
"
1020
REM.
.
.
MORE PROGRAM LINES HERE
1100 RETURN
Note
that
MERGE
closes
all
files
and
clears
all
variables.
Upon
completion,
BASIC
returns to the
command
mode.
7-30

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents