ProvideX V8.20 > Language Reference > 2. Directives
275
REDIM Directive
          Re-Dimension Array
Format
REDIM array_name[$](subscript_1[,subscript_2[,subscript_3]])
Where:
array_name[$] Numeric or string variable to be dimensioned as an array.
1st dimensions (minimum:maximum) of array. Numeric
subscript_1
expression, integers.
2nd dimensions (minimum:maximum) of array. Numeric
subscript_2
expression, integers.
3rd dimensions (minimum:maximum) of array. Numeric
subscript_3
expression, integers.
Description
The REDIM directive is used to re-dimension an array without destroying data
already contained within the array. All existing data is preserved in the exact same
location within the re-dimensioned array. This directive will work on string or
numeric arrays.
Note: Data in array elements that do not exist in the re-dimensioned array are
discarded.
Example
DIM X[1:10]
X[5] = 5, X[6] = 6
REDIM X[-5:20,4 ]
X[5,0] has 5 and X[6,0] has 6 because the default second index is 0; i.e., the
original dimension was effectively the same as X[1:10,0:0,0:0].
See Also
DIM Define Arrays and Strings, p.85,
DIM( ) Function, p.413