Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
IOResult Function
◄Summary► ◄Details► ◄Example► ◄Back►
Returns
Word Status of the most recent I/O operation
Description
The IOResult function returns the error code from the most recent
input or output operation. IOResult returns 0 if the operation was
successful.
The code returned is a run-time error number. The error number
matches one of the MS-DOS(R) extended error codes for an MS-DOS
Interrupt 21H function call. Consult a DOS reference for a list of
these errors.
I/O errors are trapped only if I/O checking is turned off. The
Input/Output-Checking directive, {$I-}, turns I/O checking off.
With I/O checking turned off, generation of run-time errors is
disabled; thus IOResult must be called after every I/O operation.
InOutRes, defined in the System unit, holds the error code.
IOResult resets InOutRes when retrieving the code. A repeat
call to IOResult, therefore, is invalid.
If I/O checking is turned off and IOResult is not called after an
I/O operation, subsequent calls to certain I/O operations will be
ignored. The following routines require IOResult to be called if
{$I-} is set and a previous I/O error has occurred:
BlockRead ║ FileSize ║ SeekEof
BlockWrite ║ Flush ║ SeekEoln
Close ║ Read ║ Write
Eof ║ Readln ║ Writeln
Eoln ║ Seek ║