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 - _quit terminate program http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _quit               Terminate program
------------------------------------------------------------------------------
 Syntax
   _quit [iExitCode]

 Arguments
   iExitCode is the exit code of the program passed to the calling process.

 Description
   The quit command terminates the program and returns to the
   calling process (i. e. DOS). Termination clean up tasks like closing
   open files are not executed. Do not use _quit if there are any
   installed interrupt handlers or your program uses the tsr()
   function.

   _quit returns iExitCode to DOS as an exit code. The iExitCode can
   be queried in a batch file using the DOS errorlevel command.

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   proc ErrorProc
   // Tell DOS of error and leave without going through the runtime
   // call back system
   ? "Runtime error", istr( __errcode )
   _quit 0xff
   endproc
   
   proc Test_quit
   vardef
      _SLIST pList
   enddef
   ? "Program start."
   on error do ErrorProc
   ? pickstr( pList, 1 ) // using an uninitialized list generates an error
   ? "Program end."      // never executed
   endpro

   proc main
   Test_quit()
   endproc

See Also: quit

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