
TextStream: ReadLine - how to detect eof
I have a script to read lines from a text file. I need to loop until
it reaches the end of the file. Does anyone know how to detect the end
of a text file?
Dim fso, file, ts...
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.GetFile("file.txt")
Set ts = file.OpenAsTextStream(1, -2) '// for reading,
tristate-default
Do
strLine = ts.ReadLine
...
Loop Until strLine <> eof '<-how to detect end of the file?