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

188 CHAIN Purpose CHAIN enables a program to be split up into a number of small sections. The CHAIN statement is used to enable one program to LOAD and RUN another program automatically. For example, one program might enable the user to enter the number of hours worked by employees and that program might CHAIN a second program which would print out the payslip. In turn that might CHAIN a third program which would do a cost per hour analysis on the data held on the file. CHAIN is also useful in a game with a lot of instructions. The instructions could all be stored as one file which would then CHAIN the main game – thus releasing a lot of the computer’s memory.

CHAIN"" (without the program name) will chain the next program on a cassette, whatever its file name. This will not work with disc filing systems where you must give the file name. For that reason it must not be used in programs which may be used on disc systems. Examples 900 CHAIN "GAME_1" 1234 CHAIN "NEWPROG" CHAIN A$ Description A statement which will load and run the program whose name is specified in the argument. All variables except @ % and A% to Z% are cleared. Syntax CHAIN Associated keywords LOAD , SAVE