(
(
The first expression
in
a subscript referring
to
an element
of
a two-dimensional array
gives
the
number
of
the
row containing
the
referenced element_ Rows are numbered
from
top
to
bottom_ The second expression
in
the
subscript gives
the
number
of
the
column. Columns are numbered from left
to
right. Thus,
the
second element
in
the
fourth row
of
a two-dimensional array named 8 can be referred
to
by
the
symbol
8(4,2),
as
in this example:
8(4,2)
= 1.53E6
The dimensions
of
an array and
the
number
of
elements in each dimension are estab-
lished when the array
is
declared.
Declaring
Arrays
Arrays can be declared either explicitly by use
of
the
USE
or
DIM
statement
or
implicitly by a reference
to
an element
of
an array
that
has
not
been explicitly
declared.
When an array
is
declared explicitly,
the
dimensions and
the
maximum number
of
data items
that
can be contained
in
each dimension are specified
in
the
USE
or
DIM
statement.
When an array
is
declared implicitly, by a reference
to
one
of
its elements when its
name has
not
appeared
in
a prior
USE
or
DIM
statement, it will have
the
number
of
dimensions specified
in
the
reference, and each dimension
will
contain
10
elements.
For example, when no prior
USE
or
DIM
statement exists for an array named A,
the statement:
A(3)
=
50
will establish a one-dimensional array containing 10 elements,
the
third
of
which
will
have
the
integer value 50. The remaining elements will be initialized
to
zero.
Likewise, when no prior
USE
or
DIM
statement
exists for an array named
8,
the
statement:
8(5,6)
=
6.913
will
establish a two-dimensional array containing 10 rows and
10
columns (100
elements), with
the
sixth element in
the
fifth row equal
to
6.913.
Arrays with dimensions
that
contain more
than
10
elements
cannot
be implicitly
declared. Thus,
without
the
appropriate prior
USE
or
DIM
statement,
the
following
statements would both cause error conditions:
A(15)
= 22.4
8(3,20)
=
66.6
After an array has been declared, either explicitly or implicitly, it
cannot
be
explicitly dimensioned by a
DIM
statement
anywhere in
the
program.
47