Hey Guys look at this code snippet:
Const ForReading = 1, ForWriting = 2, ForAppending = 8
DIM objFile, strFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
strFile = "UIFileSpecs.txt"
Set objFile = objFSO.OpenTextFile(strFile, ForReading)
Do While Not objFile.AtEndOfStream
'Line 1 contains the age in days of the files were looking for
For i = 0 to 1
objFile.ReadLine
Next
StrAgeOfFile = objFile.ReadLine
'Line 2 contains the 2nd extension of the files were looking for
For i = 1 to 2
objFile.ReadLine
Next
StrExtension1 = objFile.ReadLine
'Line 3 contains the 3rd extension of the files were looking for
For i = 2 to 3
objFile.ReadLine
Next
StrExtension3 = objFile.ReadLine
'Line 4 contains the 4th extension of the files were looking for
For i = 3 to 4
objFile.ReadLine
Next
StrExtension4 = objFile.ReadLine
'Line 5 contains the 5th extension of the files were looking for
For i = 4 to 5
objFile.ReadLine
Next
StrExtension5 = objFile.ReadLine
'Line 6 contains the 6th extension of the files were looking for
For i = 5 to 6
objFile.ReadLine
Next
StrExtension6 = objFile.ReadLine
I am scanning and assigning variables for each line - 50 of them in fact. In the text file being scanned for this test there are only 6 lines. But even though I have the Do While Not objFile.AtEndOfStream at the beginning and though you cant see it here, I do have the Loop terminator at the end of the code. I keep getting the following error after the 3rd line in the text file:
---------------------------
Windows Script Host
---------------------------
Script: E:\MasterMkDirTemplateExtByDte.vbs
Line: 50
Char: 5
Error: Input past end of file
Code: 800A003E
Source: Microsoft VBScript runtime error
---------------------------
OK
---------------------------
Any ideas...???
Const ForReading = 1, ForWriting = 2, ForAppending = 8
DIM objFile, strFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
strFile = "UIFileSpecs.txt"
Set objFile = objFSO.OpenTextFile(strFile, ForReading)
Do While Not objFile.AtEndOfStream
'Line 1 contains the age in days of the files were looking for
For i = 0 to 1
objFile.ReadLine
Next
StrAgeOfFile = objFile.ReadLine
'Line 2 contains the 2nd extension of the files were looking for
For i = 1 to 2
objFile.ReadLine
Next
StrExtension1 = objFile.ReadLine
'Line 3 contains the 3rd extension of the files were looking for
For i = 2 to 3
objFile.ReadLine
Next
StrExtension3 = objFile.ReadLine
'Line 4 contains the 4th extension of the files were looking for
For i = 3 to 4
objFile.ReadLine
Next
StrExtension4 = objFile.ReadLine
'Line 5 contains the 5th extension of the files were looking for
For i = 4 to 5
objFile.ReadLine
Next
StrExtension5 = objFile.ReadLine
'Line 6 contains the 6th extension of the files were looking for
For i = 5 to 6
objFile.ReadLine
Next
StrExtension6 = objFile.ReadLine
I am scanning and assigning variables for each line - 50 of them in fact. In the text file being scanned for this test there are only 6 lines. But even though I have the Do While Not objFile.AtEndOfStream at the beginning and though you cant see it here, I do have the Loop terminator at the end of the code. I keep getting the following error after the 3rd line in the text file:
---------------------------
Windows Script Host
---------------------------
Script: E:\MasterMkDirTemplateExtByDte.vbs
Line: 50
Char: 5
Error: Input past end of file
Code: 800A003E
Source: Microsoft VBScript runtime error
---------------------------
OK
---------------------------
Any ideas...???