How to redim a two dimensional array [RESOLVED]
I'm trying to resize a two dimensional array while preserving its contents in VBScript but it crashes with a Type Mismatch error. For some reason on my Redim statement it doesn't like the X variable. Can anyone tell me why, or what it is I'm doing wrong? A regular Redim statement works fine with the X.
VB Code:
X=0
Set FS = CreateObject("Scripting.FileSystemObject")
Set inFile= FS.GetFile("test.txt").OpenAsTextStream(1, -2)
Do While Not inFile.AtEndOfStream
Redim Preserve arrLines(X, 12)
tmp = inFile.Readline
X=X+1
Loop
inFile.Close
Re: How to redim a two dimensional array
When you use Preserve to redim an dynamic multidimensional array you can only resize the last dimension and can not change the lower bounds. If you try to will generate an error.
Re: How to redim a two dimensional array