Sharp MZ-80A Owner's Manual page 66

Hide thumbs Also See for MZ-80A:
Table of Contents

Advertisement

56
Primary
Array
has the Strength of
100 Men
Now, consider the substitution of variables for 100 items of data. The use of variables A1 and
A2 makes the
following possible.
10
A1
=5
20 A2
=
30
30 A3
=
12
Just a
minute.
This
is
terribly hard work for
writing
100 statements!
For
this, the
primary
array
is
available
as
a
new type of variable, which makes
program
generation
very convenient. Now, let's look
at
what the primary array is
all about.
A($o)=2+3
This
means
that the
computation
of
expression
2
3
should
be
put
into the
prepared A (50).
A(o)
z=A(io)+8
Now, you have understood what the
primary array
is.
haven't you?
Using the primary array, the program has been
generated as follows:
10
DIM
A
(100)
20 FOR J
=
1
TO
1
00
30 READ
A
(J)
40
NEXT
J
50 DATA
5.
30,
12
See, the
program
is very
short. As
is clear
from this
example, variables in the form of an array
can
assign
the parenthesis
of subscribed
variables,
such as
A
(J),
with variable
J.
This is the main feature
of the
primary
array
.

Advertisement

Table of Contents
loading

Table of Contents