X(0,0) = 8.6
X(1,0) = 7.3
X(0,1) = 3.5
X(1
,1) = 32.6
With BASIC, you may have
as
many dimensions
in
your array as your
program space allows. Here is
an
example of a three-dimensional
array named L which contains these eight elements:
L(0,0,0) = 35233
L(0,1
,O)
= 96522
L(0,0,1) = 52000 L(0,1,
1)
= 10255
L(1,0,0)
= 33333 L(1, 1,0) = 96253
L(1,0,1) = 53853 L(1,1,1) = 79654
BASIC assumes that
all
arrays contain
11
elements
in
each
dimension.
If
you want more elements you must use the DIM
statement at the beginning of your program to dimension the array.
For example, to dimension array
L,
put this line at the beginning of
the program:
DIM
L<1t1t1)
to allow roorn for two elements
in
the first dimension; two
in
the
second, and two
in
the third for a total of 2 * 2 * 2 = 8 elements.
How
BASIC
Stores Data
The way BASIC stores data determines the amount of memory it
consumes and the speed
in
which BASIC can process
it.
Numeric
Data
You may get BASIC
to
store all numbers
in
your program as either
integer, single precision, or double precision.
In
deciding how to get
BASIC to store your numeric data, remember the tradeoffs. Integers
are the most efficient
and
the least precise. Double precision is the
most precise and least efficient.
Integers
(Fastest
in
Computations,
Limited
in
Range)
To
be
stored as
an
integer, a number must
be
whole and
in
the range
of -
32768 to 32767.
An
integer value requires two bytes of memory
for storage. Arithmetic operations are faster when both operands are
integers.
For example:
1
3200
-2
500
-12345
can
all
be
stored
as
integers.
2-30