EasyManua.ls Logo

Radio Shack TRS-80

Radio Shack TRS-80
236 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Appendix
B:
Cassette
Data
Files
The
material in this
Appendix
is optional and yet
very important.
The
more practical
pro-
gramming you
do,
the more you'll
appreciate
your
TRS-80's
data file
capabilities.
They
allow
you to go
from the
world of programming
to the larger world
of data
processing.
Up
to now we've
relied on
LEVEL
I's 26 number
variables
A to Z,
876 (or less) array
loca-
tions A(X), two
string variables
A$ and B$,
and DATA lines
to
store the data
our programs
need. This leaves us with two
limitations:
1.
The Computer's
memory
may not be large
enough
to
hold
all the
data
we need (for
example,
an
inventory
list).
2.
When
we
turn off the
Computer, the values of
A,B,A(X),
etc., are lost.
Cassette
data
files
solve both
of these problems. We can save
huge
quantities
of
information
on tape
and
retrieve
them later,
just as we save and reload
programs.
Only instead
of the
commands CSAVE and
CLOAD,
we use the special statements
PRINT
# and INPUT
#.
Press RECORD
and PLAY keys
on
your Recorder
at
the
same time,
then type in the fol-
lowing
lines
and
run s
50 A=l
:B
=
2
jC
=
3
100
PRINT
# A ;
"
,
"
;B ;
"
,
"
;
C
Note
the special
punctuation
required
to
separate
each variable to be printed onto tape.
The sequence of
five
characters {;",";)
must be inserted
between
every two variables in
a
PRINT # statement.
This program causes
three
things to happen:
1. The Tape Recorder is automatically
started (assuming
you have it set in
the RECORD
mode).
2.
The
values
of
A, B and C
are written
onto the
cassette.
3. The Recorder is
automatically
stopped. (You
should
then
press
STOP on
the
Recorder
to disengage the recording
head.)
You
now
have
a permanent
record which can easily be read
back;
into the Computer. Note
that
the
variables
A, B
and
C
are not written onto the tape
just
the values of those vari-
ables (in this
case,
1,
2
and
3)
are stored.
What we mean is,
ymt^t
bk
i-ilife
to (Mlpts
m6re
with larger quantities
of
information.
perform the exercises;
m this
Appejidtx^
you
_
need
to
keepyoar
Tape
Recorder
connected
and
set in the
pioper
mode
RECORD,
&LAY
or
STOP
as
indicated
in
the
text.
Inse&iE
blank
cassettetapeandset the
tape
countette zero
so
you
11
know
where
you
started the -d I'-Sle,...
:.:
:::,
221

Other manuals for Radio Shack TRS-80

Related product manuals