Chapter
61
Arrays
Page 2
Month
2
Page
1
Month
1
Row
1
Week
1
Row 2
Week
2
Row 3
Week
3
Row
4
Week
4
Col
1
Col 2 Col
3
Grocery
Gas Clothes
Imagine the third dimension as an entirely new page. Here, you
refer
to
an element in the array by using
3
subscripts:
A(page, row, column)
For
example, in A(1,2,1), the first subscript
(1)
stands for the
month. The second subscript (2) stands for the week and the
third subscript
(1)
stands for the Grocery category.
So
A(1,2,1)
contains the Grocery expense for the second week
of
the first
month.
Types
of
Arrays
Arrays may be
of
any type: string, integer, single precision, or
double precision. You can have a maximum
of
255 dimensions in
your array and a maximum
of
32,767 elements in each dimen-
sion.
The amount of memory that an array occupies is equal
to
the
number
of
bytes it takes
to
store that type
of
variable times the
number
of
elements.
For
example, if you have a double precision
array of 30 elements, it occupies 240 bytes of memory. Remem-
ber, double precision numbers are stored in
8
bytes
of
memory.
62