EasyManua.ls Logo

Radio Shack TRS-80 - Page 129

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...
PRINT
MEM
and you will
get
a return of about
3370
We have
3370
memory cells left
unusued.
Again using the
calculator mode,
type:
PRINT 3370/4
-1
and
we get
841.5
Thus,
by
dividing
the remaining memory by
4,
and
subtracting
1,
we
found
there
is room
for
841 more array
elements.
Lots
of
room
left. We never had it so
good.
Each
array ele-
ment occupies 4 memory locations, whereas each letter variable requires
only
1.
Well, with memory to burn,
let's
just arbitrarily assign array
locations
101
through
110
to
hold
the color
code.
We
also have
to put the
color
code info in the program
using
a DATA
statement.
From the table,
type:
300
DATA
3,1,4,3,2,4,3,2,1,3
and
80 FOR S
=
101
TO 110
85
READ
A(S)
90
NEXT
S
... to
load the
color
code DATA into the array. The array
element
numbers
11
through
100
are not used, nor are those from 111 to the end of memory,
since
they have not been
formally assigned
any values.
Now we
need
to
find
some way to
display
all this good information.
Change these
lines:
10 IN.
"WHICH CAR'S ENGINE
6 COLOR
DO YOU
WANT
TO KNOW";W
180 P.
"LICENSE
#",
"ENGINE SIZE"
,
"COLOR CODE"
210 PRINT
W, A(
W)
,
A (
W+100)
'flmt'i
for41t
of
memory.
With
more
memory
*rti«
841.5 figure
assumes
you have
only 4K of
U
memory-
With
more
memory
, the ^number would
be
corres|>ondrogly
higher.
Yott might stash
that
bit
of
information
away
ft»
safe
keej>i
tig.
In
a
long
program
where memory
might
get scarce
you
may want
to
refer
to it.
127

Other manuals for Radio Shack TRS-80

Related product manuals