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

165 That has created a file called "DRINKS" which has been stored on cassette. The program to read the file back in is also straightforward. 10 Y=OPENIN "DRINKS" 20 REPEAT 30 INPUT Y , R$ 40 PRINT R$ 50 UNTIL R$="STOP" 60 CLOSE# Y When this is run, the list will appear on the screen as it is read from the cassette. >RUN WHISKY VODKA GIN WINE CIDER TOMATO JUICE STOP For most applications that is all you will need to know about file handling and you will only use statements like these *CAT X=OPENIN "FILENAME" X=OPENOUT "FILENAME" PRINT#X,A,B$ INPUT#X,A,B$ CLOSE#X "FILENAME" is the name of the file which normally consists of up to ten letters but see chapter 35 for more details.

A and represent any (and as many) numeric and string variables as you wish to record. X is a numeric variable used to remember the channel number allocated to the file number. For more specialised applications a number of other functions and statements are provided. BGET# and BPUT# enable single characters to be input and output. They would be used for recording special data, for example, laboratory experiments. EXT# and PTR# are used with disc systems where random access files are required. They cannot be used with cassette systems.