Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF

371 37 How to merge two BASIC programs There are a number of ways of merging two BASIC programs. Two methods are given below which will work for both disc and cassette. The line numbers in the two programs should not clash unintentionally. In order to merge two programs it is necessary to save one of them as an ASCII file rather than in the usual compressed format. This ASCII version of the program is then merged into the other program using the command *EXEC . Suppose we wish to merge the program SHORT into the program LONG .

First, load in one of the programs LOAD "SHORT" *SPOOL SHORT2 LIST *SPOOL and then create an ASCII version by typing in the next three lines This produces an ASCII version of the program. The ASCII version is called SHORT2 . Now load in the big program by typing LOAD "LONG" and finally merge in the small program by typing *EXEC SHORT2 The command informs the computer that anything that it outputs to the screen is also to be sent to a file called SHORT2 . When the computer lists the file it therefore creates an ASCII listing. The command *SPOOL without a file name is used to end or close the spooled file. *SPOOL SHORT2