DIMENSION command
Creates a one-dimensional or two-dimensional array of memory variables.
Note:
DIMENSION is identical in operation and syntax to the DECLARE command. See the DECLARE command for more information.
DIMENSION ArrayName1(nRows1 [, nColumns1]) [AS cType]
[, ArrayName2(nRows2 [, nColumns2])] ...
Parameters< /p>
ArrayName1
Specify the array name. Tip:
You can create multiple arrays with one DIMENSION command by including multiple array names, for example, ArrayName2, ArrayName3, and so on.
nRows1 [, nColumns1]
Specify the size of the array to be created. NOTE:
Each array created using DIMENSION must have a specified size. Array size is limited by available memory, which may affect performance, especially for very large arrays. Make sure your computer has enough memory to accommodate the maximum size of your array.
To create a one-dimensional array, only nRows1 should be included. In this case, DIMENSION uses nRows1 to create the number of rows in a single-column one-dimensional array. For example, the following command creates a 1D array gaArrayOne with 10 rows and 1 column:
DIMENSION gaArrayOne(10)
To create a 2D array, include both nRows1 and nColumns1. In this case, nRows1 specifies the number of rows in the array, and nColumns1 specifies the number of columns in the array.
The following example creates a two-dimensional array gaArrayTwo with 2 rows and 4 columns:
DIMENSION gaArrayTwo(2,4)