ajtsystems
IS-IT--Management
Hi,
A simple one I think. Is there a way I can echo the first 2 entries in an array:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile1 = objFSO.OpenTextFile("C:\Scripts\results.txt", 1)
'check through text file and create 1d array
Do Until objFile1.AtEndOfStream
Redim Preserve arrFileOut(i)
arrFileOut(i) = objFile1.ReadLine
i = i + 1
Loop
'Read through array from last line to 1st line
For l = Ubound(arrFileOut) to LBound(arrFileOut) Step -1
errorline = arrFileOut(l)
wscript.echo errorline
next
This array echo from the bottom up.....
Thaks
A simple one I think. Is there a way I can echo the first 2 entries in an array:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile1 = objFSO.OpenTextFile("C:\Scripts\results.txt", 1)
'check through text file and create 1d array
Do Until objFile1.AtEndOfStream
Redim Preserve arrFileOut(i)
arrFileOut(i) = objFile1.ReadLine
i = i + 1
Loop
'Read through array from last line to 1st line
For l = Ubound(arrFileOut) to LBound(arrFileOut) Step -1
errorline = arrFileOut(l)
wscript.echo errorline
next
This array echo from the bottom up.....
Thaks