Dimension matrix (rows, columns) [ ,matrix (rows, columns) ] ... Dimension vector (max) [ , vector (max) ] ...
matrix is a two-dimensional array to be dimensioned.
rows is the maximum number of rows in the array.
columns is the maximum number of columns in the array.
Arrays can be redimensioned at run time. You can change an array from one-dimensional to two-dimensional and vice versa.
The values of array elements are affected by redimensioning as follows:
If there is not enough memory for the array, the Dimension statement fails and a following InMat function returns 1.
To assign values to the elements of the array, use the Mat statement and assignment statements.
This example illustrates how a matrix can be dimensioned dynamically at run time based on incoming argument values:
Subroutine MyRoutine(InputArg, ErrorCode) ErrorCode = 0 * InputArg is 2 comma-separated fields, being the dimensions. Rows = Field(InputArg, ",", 1) Cols = Field(InputArg ",", 2) Dimension MyMatrix(Rows, Cols) If InMat = 1 Then * Failed to get space for matrix - exit with error status. Call DSLogWarn("Could not dimension matrix","MyRoutine") ErrorCode = -1 Else * Carry on. ... End