Installation guide

Programming Commands 87
DIM Miscellaneous Command
ACTION: Declares an array variable and allocates storage space.
PROGRAM SYNTAX: DIM variable(dimension,dimension,etc)
DIM variable$(dimension,dimension,etc)
REMARK: The “option base zero” for array notation is used, in which the first ele-
ment of each array dimension is annotated as element “0”. Therefore,
the total number of elements in the array is: (dimension1 +
1)*(dimension2 + 1) * ... *(dimension n +1).
Example notation for a two-dimensional array:
Y
0
Y
1
Y
2
Y
n
X
0
X
1
X
2
X
n
EXAMPLE: DIM x(10,10,10)
The variable x is three-dimensional array with 11*11*11 , or 1331
elements.
DIM a$(3,3,3)
The variable string a$ is a three-dimensional array with 4*4*4, or 64
elements.
DIM A(3,3,3) ‘ 4 * 4 * 4 or 64 elements
A (3,1,2)=5.0
0,0,0
0,0,1
0,0,2
0,0,3
0,1,0
0,1,1
0,1,2
0,1,3
0,2,0
0,2,1
0,2,2
0,2,3
0,3,0
0,3,1
0,3,2
0,3,3
1,0,0
1,0,1
1,0,2
1,0,3
1,1,0
1,1,1
1,1,2
1,1,3
1,2,0 1,2,1 1,2,2 1,2,3 1,3,0 1,3,1 1,3,2 1,3,3
2,0,0 2,0,1 2,0,2 2,0,3 2,1,0 2,1,1 2,1,2 2,1,3
2,2,0
2,2,1
2,2,2
2,2,3
2,3,0
2,3,1
2,3,2
2,3,3
3,0,0
3,0,1
3,0,2
3,0,3
3,1,0
3,1,1
3,1,2
5.0
3,1,3
3,2,0
3,2,1
3,2,2
3,2,3
3,3,0
3,3,1
3,3,2
3,3,3