when you use the FBC (for DOS) and try to load a text file in the following way:
Code: Select all
dim i as integer
dim l as string
open "test11.txt" for input as #1
while not eof(1)
line input #1, l
if i>10 then print "Aborted": exit while
And the text file (text11.txt) contains of just a single EOF character (ASCII 26 / &H1A) then this program will print 10 lines instead of zero (or one). Please remember that this kind of files were very common in DOS enviroments.
The problem is in fb_FileEof when you check for the file pointer instead of feof() for an INPUT mode file.