LOTUSSCRIPT LANGUAGE
Declares a dynamic array and allocates storage for it, or resizes an existing dynamic array.
Syntax
ReDim [ Preserve ] arrayName ( bounds ) [ As type]
[ , arrayName ( bounds ) [ As type ] ] ...
Elements
Preserve
[ lowerBound To ] upperBound
The lowerBound is the minimum subscript allowed for the dimension, and upperBound is the maximum. If you don't specify a lowerBound, the lower bound for the array dimension defaults to 0, unless the default lower bound has been changed to 1 using the Option Base statement.
Array bounds must fall in the range -32768 to 32767, inclusive.
You cannot change the data type of an existing array. If arrayName was declared and type is specified in the current ReDim statement, type must match the original data type of arrayName.
A ReDim statement allocates storage for a dynamic array. You can resize the array with additional ReDim statements as often as you want. Each time you resize the array, LotusScript reallocates the storage for it.
Unlike a Dim statement, ReDim cannot specify an array as Private, Public, or Static. To specify a dynamic array with one of these characteristics, declare it first in a Dim statement. If you declare a dynamic array with a Dim statement, LotusScript doesn't allocate storage for the array elements. You can’t actually use the array in your script until you allocate storage with ReDim.
Arrays can have up to 8 dimensions. The first ReDim statement for an array sets the number of dimensions for the array. Subsequent ReDim statements for the array can change the upper and lower bounds for each dimension, but not the number of dimensions.
If Preserve is specified, you can change only the upper bound of the last array dimension. Attempting to change any other bound results in an error.
Do not use ReDim on a fixed array (an array already declared and allocated by a Dim statement).
If you're using ForAll on a container variable that is an array of arrays, do not ReDim the reference variable (this generates the "Illegal ReDim" error).
Example See Also