Radio Shack TRS-80 Model 100 Basic Manual page 132

Basic language lab
Hide thumbs Also See for TRS-80 Model 100:
Table of Contents

Advertisement

Experiment #3 Saving to a Cassette File
While
it
is quite convenient to save data in RAM, this can use up valuable memory
rather quickly. An alternative is to save the data file to cassette. Since the cassette
recorder uses removable cassette tapes, you have an essentially unlimited storage
capacity for your files. The disadvantage of using cassette data files is that you have
to be sure the recorder is properly attached and the tape is correctly positioned for
both writing and reading.
Attach your cassette recorder to the computer (consult the Owner's Manual if you
have any questions). Insert a blank tape in the recorder and rewind it. Advance the
tape past any leader using the fast forward key.
Load program EXPI using the command:
LOAD"EXP1" (ENTER)
Change Line 110 to:
110 OPEN "CAS:NAMES" FOR OUTPUT AS 1
List the program to confirm that it is:
100 CLS
110 OPEN "CAS:NAMES" FOR OUTPUT AS 1
120 INPUT "NAME"; N$
130 IF N$
= ""
GOTo 200
1£10 PRINT #1
t
N$
150 N$
= "" :
GO TO 120
This is the same program used in Experiment 1 to write a RAM file, except that the
device in the OPEN statement in LINE 110 has been changed to "CAS:".
Press the RECORD and PLAY keys on the cassette recorder together. Execute the
program and enter the following names when prompted to do so:
NAME? Joan Smith
NAME? Patty Wolf
NAME? Allison T. Cornpone
NAME? Jill Shoe
NAME? SallY
Ma~net
NAME? Roxanne o/ShacK
NAME?
Note that the cassette recorder will run for a few seconds and then stop before you are
able to enter any names. Press
(ENTER)
without entering any name to terminate
execution. After the last name is entered, the cassette recorder will run for a few
seconds and then stop.
At this point, the data file "NAMES" has been written on the cassette tape. To verify
this, you will have to proceed to the next experiment.
126

Advertisement

Table of Contents
loading

Table of Contents