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




Reply With Quote