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 - __errcode current error code http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 __errcode           Current error code
------------------------------------------------------------------------------
 Declaration
   system.hdr

 Syntax
   uint __errcode

 Default
   0 (no error).

 Description
   The __errcode system variable contains the error code after a runtime
   error. If the application installed a custom error handler, activated
   by the on error do command, the error handler can query __errcode
   and can perform actions accordingly (like displaying a message) before
   the program exits.

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   proc ErrorProc
   alert( "Runtime error " + istr( __errcode ) + ";" + emessage(), ;
      " Exit program ", RED_WHITE, BLUE_YELLOW )
   quit
   endproc
   
   proc Test_errcode
   on error do ErrorProc                  // install custom error handler
   ? "Current runtime error code is", istr( __errcode )
   wait "Press a key to generate a runtime error"
   ? pickcount( 0 )                       // generate an error
   endproc

   proc main
   Test_errcode()
   endproc

See Also: imessage() on error do

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