Link to home
Start Free TrialLog in
Avatar of bpl5000
bpl5000

asked on

"Input past end of file" error occurs during do loop

In a Do loop, I get an "input past end of file"  Here is the code:

1        Do
2            Line Input #1, strLine
3            strLine = Replace(strLine, strToBeReplaced, strReplacement)
4            Print #2, strLine
5        Loop Until EOF(1)

The error happens after the output is complete and it happens at line 2... "Line Input #1, strLine".  I don't understand why I would get an "input past end of file error" when I am using "Loop Until EOF".  Any ideas?

Thanks for the help!
ASKER CERTIFIED SOLUTION
Avatar of amit_g
amit_g
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bpl5000
bpl5000

ASKER

Ok, I realized that the reason it wasn't working is because the last file that it was opening for input was empty.  Anyway, both solutions above will solve the problem.

Thanks for the help!