Error Message EOF

Blitz3D Forums/Blitz3D Beginners Area/Error Message EOF

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

if you post the file access code we can better see the problem.

Unexpected end of file could be because you are attempting to read past the end of the file. For example if there are 100 items in your file and your code is trying to read 101 items from it youve got a problem

try adding an eof evaluator to the end of the loop, ie:
file=readfile("name.dat")
repeat
    whatever = read{line/byte/int/float} (file)
until eof(file)

this will repeat until the end of data.

Alternatively if using a for next..
for ....
   if not eof(file)
      whatever= readline(file)
   else
      exit
   endif
next