EasyManua.ls Logo

Radio Shack TRS-80 Model 3 - Page 185

Radio Shack TRS-80 Model 3
276 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...
All
we
do
is increase the size
(or'
'depth'
')
of
each
dimension as needed.
Let's
assume
our
checkbook
includes
check
numbers 001 through
300,
and we want to
storethe entire
checkbook
record. Just make these changes:
'1·0
DIM
C~~(300,:3)
50
FOR
ROW
= 1
TO
300
'SET
UP
A
300
BY
3
ARRAY
and
add
DATA
lines for check numbers 001 through 300.
You'd
probably want to
pack
more
data
onto
each
DATA
line than we did in the above
DATA
lines.
And
you'd
change
all the
ROW
counterfinal values:
150
FOR
ROW
- 1
TO
300
240
FOR
ROW
= 1
TO
300
Other
Types ofArrays
Remember,
in
Model
III
BASIC
the
number
of
dimensions an array can have (and
the size
or
depth
of
the array), is limitedonly by the amount
of
memory available. Also
remember
thatstring arrays
can
be
used.
For
example,
C$(X)
would automatically
be
interpreted as a string array.
And
if
you use
DEFSTR
Aat the beginning
of
your
program,
any array
whose
name
begins with A would also be a string array.
One
obvious application for a string array would
be
to store text material for access
by
a
string manipulation
program.
10
CL.EAR
1200
20
DII'1
TXT$(
10)
would set
up
a string array capable
of
storing 10 lines
of
text. 1200 bytes were
CLEARed
to allow for 10 sixty-characterlines, plus
600
extrabytes for string
manipulation with
other
string variables.
6/3

Related product manuals