Download Print this page

Radio Shack TRS-80 model III Owner's Manual page 145

Mini-disk operation, trsdos disk operating system, disk basic programming language
Hide thumbs Also See for TRS-80 model III:

Advertisement

TRS-80
MODEL
III
DISK
SYSTEM
AS
becomes
a
two-byte
representation
of
the integer portion
of
s/i
Any
^Z:\TTk
T;f-
^
th3t
A$
m
thlS
Case
ic
a
normal ^ring
vanable, not
a buffer-
field
name.
Suppose baseball/bat
(a
non-standard
file
extension) has
been opened
for
random
access using buffer
2,
and
the buffer
has
been FiELDed
as
follows
field:
length:
NM$
16
YRS$
2
AVG$
4
HR$
2
AB$
4
ERNINGS
4
nm$
is
intended
to
hold
a character
string;
avgs, ab$ and
ernings, converted
single-precision values;
yrs$ and
hr$, converted
integers.
Suppose
we
want
to
write the
following data
record:
slow
learner
played 38
years; lifetime batting
average
123-
career
homeruns,
11;
at
bats,
32768;... .earnings
-
13.75.
'
Then we'd
use
the
make-string
functions
as follows:
1000 LSET
NM$="SL0W LEARNER"
1010 LSET
YRS$=MKI$(38)
1020
LSET AVG*=MKS*(,123)
1030 LSET
HR$=MKI$(11)
1040 LSET
AB$=MKS$(32768)
1050 LSET
ERNING$=MKS*(-13.75)
After
this
sequence,
you
can
write
slow
learner's
information
to
disk with
he
put
statement.
When
you
read
it
back from
disk
with get,
you
will
need
to
restore the
numeric
data
from
string to
numeric
form, using cvi
and cvs
144

Advertisement

loading