Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2006-08

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

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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
Alexandre Leclerc
to 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