Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why do I get Input past end of file error message 1

Status
Not open for further replies.
Dec 17, 2006
8
CA
Open 761 For Input As #5
Input #5, ddd
Text1.Visible = True
Text1.Width = 4000
Text1.Height = 4000
Text1.Text = ddd

Text1.Text = Input$(LOF(5), #5)
Close #5

I wrote a text using a text box and saved it in file 761.
After that I wish I could open and read the text with the above code.
However,I keep getting this error message "Input past end of file"
The text exists as I verified it using Notepad.

Any ideal what is wrong ?

Thank you

GubertDisentis
 
Your first read of the file (i.e. Input #5, ddd) reads to the end of the file and raises EOF. The second attempt (i.e. Text1.Text = Input$(LOF(5), #5) ) raises the error because you are already at EOF.

Just drop that line.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top