|
-
Jun 19th, 2009, 03:39 PM
#1
Re: problem with eof...
I haven't used "Input " that way in years. If I remember correctly, you are getting two values from the file: slang & means. I don't see where those are declared but am assuming they are strings. If I do recall correctly, then if your file doesn't contain pairs of values throughout the file, you will get the error. This is because your code is trying to input slang, which works, but there is no more data to input means -- error. I would imagine your error is probably caused by a blank line within your file. Worth a check. If you can't figure it out, you might want to post your file
-
Jun 19th, 2009, 03:56 PM
#2
Hyperactive Member
Re: problem with eof...
The Input command will read a line until it reaches CRLF (noting the end of the line), and it will then move on to the next line. If the last line in your file does not have CRLF, the routine will read past the end of file and will throw an error.
To fix this, open your list file in a common editor like Notepad. Go to the very last character of the very last line, and then press the Enter key! This will create a a CRLF at the end of that line and your cursor will jump to the next line below it. Save your file, and then run your routine. It should work now.
-
Jun 19th, 2009, 05:59 PM
#3
Re: problem with eof...
 Originally Posted by Quiver318
The Input command will read a line until it reaches CRLF (noting the end of the line), and it will then move on to the next line. If the last line in your file does not have CRLF, the routine will read past the end of file and will throw an error.
Not quite. Line Input #n will read an entire line. The code posted in #1 above is not using Line Input.
Edited: It really depends on the formatting of the text/data within the file.
Example: Apples, Bananas, Grapes :: Input #n, strFruit will read each word individually even if they are on the same line
Example: Apples Bananas Grapes :: Input #n, strFruit will read entire line in this case; same result as using Line Input
Last edited by LaVolpe; Jun 19th, 2009 at 06:12 PM.
-
Jun 19th, 2009, 08:57 PM
#4
Hyperactive Member
Re: problem with eof...
 Originally Posted by LaVolpe
Not quite. Line Input #n will read an entire line. The code posted in #1 above is not using Line Input.
You are quite right. I had confused Input with LineInput. Sometimes all these commands run around in my head until I cannot sleep at night. Sorry for the confusion.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|