EOF error message

Archives Forums/Blitz3D Bug Reports/EOF error message

Raul(Posted 2006) [#1]
Hi,

When I test the EOF instruction, I get an error message :(
.. is it relative to the last update ?

Thanks


GfK(Posted 2006) [#2]
It depends what your code is like, and how you're using Eof(). It should be something along the lines of:
FILE% = ReadFile("textfile.txt")
If FILE
  Repeat
    S$ = ReadLine(FILE)
  Until Eof(FILE)
  CloseFile FILE
EndIf

On a slightly related note, its always better to confirm with other people that something is a bug or not before posting in the bug reports forum. Saves BRL from having to decide what is and what isn't.

Should always post a code sample wherever possible, too, or at the very least tell us what the error message is.


Raul(Posted 2006) [#3]
I just try the EOF example!
It's true that your example work fine and it is not a bug, however ... why not change the example code ?

Merci pour la correction.
----------------------------------------------------


; Eof sample

file$="c:autoexec.bat"

filein = ReadFile(file$)

Print "Here is your Autoexec.bat file ..."

; Loop this until we reach the end of file
While Not Eof(filein)
Print ReadLine$(filein)
Wend


markcw(Posted 2006) [#4]
users can add improved samples to the on-line blitz3d manual, see this link:

http://www.blitzbasic.com/b3ddocs/command.php?name=Eof&ref=2d_a-z


Raul(Posted 2006) [#5]
Big sorry: it is not a bug (just an error occured by "c/autoexec.bat" wrong path)

I am not able to add comments in the help section because I didn't practice the English language enough.

That's sorry because there is many **wrong informations** who can disappoint beginners (especially the errors I saw in the TYPE section --the most complicated instructions to learn--).

I don't know why I think about bug when I get error message by the EOF example (perhaps need I go to sleep some hours).

Merci pour votre indulgence !


jfk EO-11110(Posted 2006) [#6]
If you see wrong descriptions in the docs, especially the online docs, then please let us know about it in detail. You may use ONE thread for everything you see.


markcw(Posted 2006) [#7]
> You may use ONE thread for everything you see.

sorry, but what does this mean, jfk? it just doesn't make any sense to me.

do you mean use one thread for everything you ever see wrong in the docs, like make a "b3d doc errors" thread?


Raul(Posted 2006) [#8]
... I don't understand what you mean.

But after many years of existence, it is strange to find several errors in the docs. Even a french guy like me find them !

When I test an instruction and it crash, I can't think about wrong doc, then I presume a bug. Sorry, I'll be more vigilant next time...


jfk EO-11110(Posted 2007) [#9]
Sorry I missed this. yes I meant a thread eg. "things to fix in the docs", could be here in the bugs section.

It's true, there are a few typos and wrong things in the docs, but it's by far not as bad as you say Raul. If you get a MAV cause your machine could not open the file c:autoexec.bat simply because it's not there, then remember the old wisdom: turn on your brain before you turn on your computer ;)