On 21 mrt 2004, at 14:56, kractor wrote:
just wondering if there's been any progress on this? not trying to pressure or anything, more curious as to what the actual problem was if its been discovered yet ... also wondering if anyone else had this problem besides me?begin readln(A); NewAlbum.Year:=StrToIntDef(A,0); write('label: '); readln(NewAlbum.alLabel); write('tracks: '); readln(NewAlbum.NumTracks);
This avoids the exception.
The problem is simply that "readln" is split into "read" and "readline_end". The former reads whatever you want to read, the latter consumes the end-of-line. The ioresult is checked after both operations. If the read already returned an error, then an exception will be raised, so the readln_end is never executed.
That's the way readln (and writeln) was implemented from the start in FPC. I don't know if there's an elegant solution possible, or that it requires to change the whole way we handle it (e.g. passing a boolean to each internal read routine that notes whether or not it should consume everything till the end of the current line, no matter what happens).
Jonas
_______________________________________________ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal