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 - _ecrit critical error information structure http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _ECRIT              Critical error information structure
------------------------------------------------------------------------------
 Declaration
   system.hdr

 Syntax
   typedef struct _ECRIT
      uint code
      byte class
      byte action
      byte source
   enddef

 Members
   code is the DOS error code.
   class is the class of the error.
   action is the code of the suggested action to overcome the problem.
   source is the code of the system resource where the problem pertains to.

 Description
   The _ECRIT structure stores information on critical errors. The
   __errcritical system variable is declared as of type _ECRIT, and contains
   information on the DOS critical error that last occurred during program
   execution.

 Example
   #define EXAMPLE_TYPE
   #include example.hdr

   proc CheckCritical2 static
   if __errcritical.code
      alert( "Critical error;;" + ;
         "Error code " + istr( __errcritical.code ) + ";" + ;
         "Error class " + istr( __errcritical.class ) + ";" + ;
         "Error source " + istr( __errcritical.source ) + ";" + ;
         "Suggested action code " + istr( __errcritical.action ), ;
         " Abort ; Retry ; Ignore ; Fail ", RED_WHITE, BLACK_YELLOW )
      __errcritical.code := 0          // reset error code
   endif
   endproc
   
   proc Test_ECRIT
   CheckCritical2()
   type "b:nonsense.txt" // this results in a critical error if no B: drive
   CheckCritical2()
   set printer to "LPT1"
   set print on
   ? "hello"       // this results in a critical error if printer is off
   CheckCritical2()
   set print off
   ? "End of program"
   CheckCritical2()
   endproc

   proc main
   Test_ECRIT()
   endproc

See Also: __errcritical

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