Radio Shack TRS-80 User Manual page 128

Micro computer system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

Get
the
idea?
Can you
see
the beginning of a simple inventory
system
for a
small business?
Let's
go one
small step
{for
mankind)
further.
Suppose you
know
the color
of each of the
10
cars,
and
for simplicity,
suppose they
are
coded
1,
2,
3
and
4.
We
might
then have a
master
chart that looks
like this:
LICENSE
#
1
2
3
4
10
ENGINE
SIZE
300
200
500
300
20p
300
400
400
300
500
COLOR CODE
3
1
4
3
In the
language of
professional
computer
types,
this
is
called a matrix.
A
matrix
is
just
an
array that has
more
than
one
dimension.
(Our
first
array
had
the
dimension
of 1
by
10.)
This
array has
a
horizontal
dimension
of 2
and
a
vertical
dimension
of 10.
If
you wanted
to
be
terribly inefficient
about
the matter,
you
could
say that
this
is
a
3
by 10
array,
count-
ing
the
license
number.
If
so,
then our
original
one would
have been a 2
by
10
array
but
who
needs
it?
As
long
as
we
keep our
license
numbers
in
a
simple
1
to
10
FOR-NEXT
loop,
and our
DATA
in
proper sequence,
we
can keep our
arrays
simpler
and
easier
to
handle.
How
then can
we
handle
this
2
by 10
matrix?
We
have
already
used
up
our
A
array
ele-
ments
numbered
1
through
10.
Oh,
you want
to
know how many
array
elements
we
have
to
work
with?
Very
good!
What
was your
name
again? (Let
me
mark
that
down.)
Assuming
you
left
our
last
program untouched,
type:
126
ENGINE
SHE?
WHAT
ENGINE?'
You
might want
to think of
a
matrix
as
a
chart
with
a certain
number
of
columns
of informatjon.
First
you
set
up
the chart,
then
how many
columns
of
info
can
you
get in
.
.
.?
-

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents