Merssage [Error](1,1): Unexpected end of file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Merssage [Error](1,1): Unexpected end of file

Alexandre Leclerc
I'm reading a file generated by another application, but it very often
trigger '[Error](1,1): Unexpected end of file'. I just can't put my
finger on the problem. I'm using Reset() and Readln().

It looks like it is not impacted by the read/write time to OS. I can't explain.

My algo for reading is:

while not eof(f)
  readln(f,s)
  process...
end;

Maybe when it read the last line it does not trigger properly the eof?
I'll test loading a file with a string list to see if it causes the
same error.

(PS: I sent this message yesterday but I think it did not reach the
list... I added 'Message' in the subject because the mailling list
tought it was a command to execute!?!)

--
Alexandre Leclerc
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Merssage [Error](1,1): Unexpected end of file

Alexandre Leclerc
There was no problems with ReadLn... after 2 hours of debugging I put
my finger on the problem; somewhere else in the software.

Sorry for that.

Regards.

--
Alexandre Leclerc
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal