I'm using this code to read every line in a series of files.

--- snip ---
Set oFile = oFSO.OpenTextFile(sLogFilePath, ForReading, False, -2)
sLineIn = oFile.ReadLine
Do Until oFile.AtEndOfStream
wscript.echo sLineIn
sLineIn = oFile.ReadLine
Loop

--- snip ---

It's worked before, but it doesn't work now. The first read, outside the DO
loop works, but it never enters the loop to read the remaining 300+ lines.
It's as if it thinks it's at EOF already. Can the content of the lines
being read effect the behavior of AtEndOfStream? Almost all of the lines in
the files end in #@ and almost all of them start with ~.

Basically, why does it think it's at EOF when it's at the beginning of the
file?

Thanks,

Tom

Re: AtEndOfStream Question by Tom

Tom
Wed Feb 22 14:55:02 CST 2006

Forget it. I found the error of my ways.

"stupid coder error"

Tom

"Tom Ker" <thomasDOTkerA@Thighmark.com> wrote in message
news:eUcFIo%23NGHA.916@TK2MSFTNGP10.phx.gbl...
> I'm using this code to read every line in a series of files.
>
> --- snip ---
> Set oFile = oFSO.OpenTextFile(sLogFilePath, ForReading, False, -2)
> sLineIn = oFile.ReadLine
> Do Until oFile.AtEndOfStream
> wscript.echo sLineIn
> sLineIn = oFile.ReadLine
> Loop
>
> --- snip ---
>
> It's worked before, but it doesn't work now. The first read, outside the
> DO loop works, but it never enters the loop to read the remaining 300+
> lines. It's as if it thinks it's at EOF already. Can the content of the
> lines being read effect the behavior of AtEndOfStream? Almost all of the
> lines in the files end in #@ and almost all of them start with ~.
>
> Basically, why does it think it's at EOF when it's at the beginning of the
> file?
>
> Thanks,
>
> Tom
>