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

166 EOF# enables a program to detect the end of the file when reading in data. It is normally used in the following way 10 Y=OPENIN "DRINKS" 20 REPEAT 30 INPUT#Y, A$ 40 PRINT A$ 50 UNTIL EOF#Y 60 CLOSE#Y Telephone book program One of the programs on the WELCOME cassette can be used to keep a personal telephone directory. Clearly it should be possible to save a copy of all your entries on to cassette and to load them back into the computer later. Several modifications must be made to the program to enable this to happen. These modifications are shown below. Once you have modified the program you can then save the corrected version with a new name, for example First, load the program.

Don’t RUN it, but type CTRL N then LIST to list the program in ‘page mode’. To move down the program, press SHIFT . When you come to a page requiring one of the changes set out below, press ESCAPE and edit the line in the normal way. SAVE "TELE2" Lines 210 to 280 omit final ' Add new lines: 282 PRINT" 9 - Load data from cassette" 284 PRINT" 0 - Save data to cassette" Change line 290 to 290 SEL = -1 In line 300 change TAB(3,22) to TAB(3,23) Line 330 change to 330 IF A 9 THEN 310 Change line 350 to 350 IF SEL> -1 THEN PRINT TAB(2,SEL+3 - 10*(SEL=0));CHR$(&89); Change line 360 to 360 PRINT TAB(2,A+3-10*(A=0));CHR$(&88);A;CHR$(&89) Change line 380 to