vbscript array dim redim
Then, at a later point in your program, you use the ReDim ReDim. Resize a dynamic array.Related: Dim - Declare a new variable or array variable Array - Add values to an Array variable Equivalent in PowerShell: Not required, arrays are resized automatically. Related: Understanding VBScript: Operators. Arrays in VBScript. Unlike all the other subtypes I showed you last month, an array can hold more than one value.You can use ReDim without Dim to create a dynamic array that has an initial index size. If you specify Preserve, Visual Basic copies the elements from the existing array to the new array.Finally, it decreases the size back to its original value and reinitializes all the array elements. Dim intArray(10, 10, 10) As Integer ReDim Preserve intArray(10, 10, 20) ReDim Preserve intArray(10, 10 Dim X(). ReDim X(10, 10, 10). ReDim Preserve X(10, 10, 15). Caution: If you make an array smaller than it was originally, then data in the eliminated elements is lost. VBScript has a infamously weak implementation of array capabilities. There often comes situations where youd like to manipulate an array and VBScript just doesnt have the functionality built in natively.ReDim aNewArray(0). Dim vLoopValue, vLimit.