Tandy 1000 Basic Reference Manual page 219

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 10 I BASIC Keywords
Sample Programs
MERGE provides a convenient means of putting program mod-
ules together. For example, a n often-used set of BASIC subrou-
tines can accompany a variety of programs with this command.
Suppose the following program is in memory:
8 0 REM
M A I N PROGRAM
9 0 REM L I N E NUMBER R E S E R V E D FOR S U B R O U T I N E H O O K
1 0 0 REM
PROGRAM L I N E
1 1 0 REM
PROGRAM L I N E
1 2 0 REM
PROGRAM L I N E
1 3 0 E N D
And suppose the following subroutine, sub.txt, is stored on disk
in ASCII format:
9 0 GOSUB 1 0 0 0 ' S U B R O U T I N E
H O O K
1 0 0 0 REM
B E G I N N I N G OF S U B R O U T I N E
1 0 1 0 REM
S U B R O U T I N E L I N E
1 0 2 0 REM
S U B R O U T I N E L I N E
1 0 3 0 REM
S U B R O U T I N E L I N E
1 0 4 0 RETURN
You can MERGE the subroutine with the main program with:
MERGE " 5 u b . t x t "
The new program in memory is:
8 0 REM
9 0 GOSUB 1 0 0 0
1 0 0 REM
1 1 0 REM
1 2 0 REM
1 3 0 E N D
1 0 0 0 REM
1 0 1 0 REM
1 0 2 0 REM
1 0 3 0 REM
1 0 4 0 RETURN
M A I N PROGRAM
' S U B R O U T I N E
H O O K
PROGRAM L I N E
PROGRAM L I N E
PROGRAM L I N E
B E G I N N I N G OF S U B R O U T I N E
S U B R O U T I N E L I N E
S U B R O U T I N E L I N E
S U B R O U T I N E L I N E
217

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents