Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - getioresult() check the result of the last i/o operation http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getioresult()       Check the result of the last I/O operation
------------------------------------------------------------------------------
 Declaration
   system.hdr

 Syntax
   func uint getioresult extern

 Arguments
   None.

 Return
   The last DOS I/O error value.

 Description
   This function returns the result of the most recent DOS I/O operation.
   It returns 0 if there was no error, otherwise a value greater than 0 will
   be returned, indicating the DOS I/O error.

   This function may be used if Force was instructed to ignore I/O errors
   by calling setiotrap() prior to a call to getioresult().

   See DOS errors in the Runtime error section of this guide.

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   proc Test_getioresult
   setiotrap( .f. )            // deactivate error trapping
   erase "c:nonsense.txt"      // attempt to erase a non-existant file
   if getioresult() > 0        // if I/O error occurred
      ? "I/O error", istr( getioresult() ) // display message
      wait
   endif
   setiotrap( .t. )            // activate error trapping
   erase "c:nonsense.txt"      // runtime error 2 is generated
   endproc

   proc main
   Test_getioresult()
   endproc

See Also: __errcritical critical() setiotrap()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson