Re: Understanding {$I-} {$I+} ioResult

"Prof. A Olowofoyeku (The African Chief)" <[email protected]>
Newsgroups gmane.comp.compilers.gpc
Message-ID <[email protected]>
On 26 Nov 2012 at 14:59, Baudouin Le Charlier wrote:

> 
> Le 26 nov. 2012 à 12:39, Prof. A Olowofoyeku (The African Chief) a
> écrit :
> 
> > On 26 Nov 2012 at 9:10, Baudouin Le Charlier wrote:
> > 
> > [...]
> >>> This is a historical factor, and there was no need to duplicate
> >>> features that Borland already documented well, and which were well
> >>> known to Borland Pascal/Delphi programmers.
> >> 
> >> I am not sure they are so well known since you did not explain to
> >> me why (i.e. by which miracle) a program that stops abruptly (when
> >> compiled with $I-), stops normally if you add a call to ioResult
> >> *after* the io statement that makes the original program fail. I
> >> doubt very much that this could be explained in the original
> >> Borland documentation and also that this behavior should be well
> >> known of Borland Pascal programmers.
> > 
> > As I said, the Borland Pascal/Delphi help files are freely available
> > on the net. If you want to use Borland Pascal/Delphi compatibility
> > features in GPC, you would do well to study the Borland
> > documentation on those features.
> > 
> > This is from a 20 year old Borland Turbo Pascal help file:
> > 
> > [--- excerpt begins ---]
> > $I:  Input/Output-Checking Switch
> > Enables or disables the automatic code generation that checks the
> > result of a call to an I/O procedure 
> > 
> > Syntax:	$I+ or $I-
> > Default:	$I+
> > Type:	Local
> > Command-Line:	/$I+ or /$I-
> > Menu Command:	Options|Compiler|I/O Checking
> > 
> > Remarks
> > If an I/O procedure returns a non-zero I/O result when the $I switch
> > is on, the program terminates, displaying a run-time error message. 
> > 
> > 
> > When the $I switch is off, you must use the IOResult function to
> > check for I/O errors. [--- excerpt ends ---]
> > 
> > Please let us stop this meaningless debate now.
> 
> To me, it is not meaningless. I sent you an example where gnu pascal
> does not conform to the excerpt you just sent me : the program is
> compiled with the switch off but nevertheless it stops with an error
> message. 

And where in that code did you use the IOResult function to check for 
errors?

Best regards,  
 The Chief
-------
Prof. Abimbola Olowofoyeku (The African Chief)
Web: http://www.greatchief.plus.com



_______________________________________________
Gpc mailing list
[email protected]
https://www.g-n-u.de/mailman/listinfo/gpc
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.