Le 26/11/2012 15:18, Prof. A Olowofoyeku (The African Chief) a écrit :
On 26 Nov 2012 at 14:59, Baudouin Le Charlier wrote: And where in that code did you use the IOResult function to check for errors?
Hmm ... May be I see the confusion
You check ioResult in the program lireToto_ioResult.pas in which you have set {$I+}, not in the program lireToto.pas in which you have set {$I-} It is the contrary you must do: if you set {$I+} the programs exits unconditionnally, and it is meaningless to try to check ioResult: you exit before having the opportunity to check it if you set {$I-} the program does not stop, and you have the opportunity to check ioResult, and decide what to do next. A common use of this is for example: if after a read(r) to read a number, you type e.g. an alphabetical letter, error pops up, but is caught, and you have the opportunity to check ioResult, see what happened in considering the error number, and ask to the user to type an other number.
Maurice