Trapping I/O runtime errors in GPC
22 Oct
1997
22 Oct
'97
5:45 p.m.
Is there a (simple) way of trapping runtime I/O errors in GPC, like the {$I-} compiler directive in Borland Pascal? Right now, the program var x : real; begin Readln (x); end. abort with a run-time error if the user enters something that is not a number. The same applies to ReadStr, BTW, so unless there is such a switch (hidden) in GPC, we have to call C functions like 'sscanf' or 'atof' to emulate the Borland 'Val' procedure. However, ReadStr + trapping runtime I/O errors would be simpler, IMHO. Jesper Lund
10544
Age (days ago)
10544
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jesper Lund