I am new to Vbscript and have come up against a problem using an array to split a string. The error is (subscript out of range). The error occurs after reading the 10th line of text. I have been looking at ways to destroy and recreate the array before looping back but cannot see a way to do this any suggestions welcome?????
Dim MyString, myarray, objfso, objtextfile
set objfso = createobject("scripting.filesystemobject"
set objtextfile = objfs
penTextFile ("c:\shares2.txt"
Do while not objTextFile.AtEndOfStream
Mystring = objTextFile.Readline
MyArray = Split(MyString,"=", -1, 1 )
wscript.Echo myarray (0)
wscript.Echo myarray (1)
loop
Dim MyString, myarray, objfso, objtextfile
set objfso = createobject("scripting.filesystemobject"
set objtextfile = objfs
Do while not objTextFile.AtEndOfStream
Mystring = objTextFile.Readline
MyArray = Split(MyString,"=", -1, 1 )
wscript.Echo myarray (0)
wscript.Echo myarray (1)
loop