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 - setiotrap() set dos error trapping mode http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 setiotrap()         Set DOS error trapping mode
------------------------------------------------------------------------------
 Declaration
   system.hdr

 Syntax
   proc setiotrap extern
   param value logical lOn

 Arguments
   lOn indicates if critical errors should be trapped.

 Return
   None.

 Description
   This procedure controls how certain I/O-related DOS critical errors are
   treated. If lOn is set to .f., such critical errors will be ignored.
   Note that only a subset of errors can be handled this way.

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   proc Test_setiotrap
   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_setiotrap()
   endproc

See Also: __errcritical critical() getioresult()

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