home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / gt_quit.prg < prev    next >
Text File  |  1993-10-14  |  1KB  |  70 lines

  1. /*
  2.     File......: GT_Quit.prg
  3.     Author....: Martin Bryant
  4.     BBS.......: The Dark Knight Returns
  5.     Net/Node..: 050/069
  6.     User Name.: Martin Bryant
  7.     Date......: 04/02/93
  8.     Revision..: 1.0
  9.  
  10.     This is an original work by Martin Bryant and is placed
  11.     in the public domain.
  12.  
  13.     Modification history:
  14.     ---------------------
  15.  
  16.     Rev 1.0 04/02/93
  17.     PD Revision.
  18. */
  19.  
  20. /*  $DOC$
  21.  *  $FUNCNAME$
  22.  *      GT_QUIT()
  23.  *  $CATEGORY$
  24.  *      General
  25.  *  $ONELINER$
  26.  *      To safely quit the application.
  27.  *  $SYNTAX$
  28.  *      GT_Quit([<nErrorLevel>]) -> NIL
  29.  *  $ARGUMENTS$
  30.  *      <nErrorLevel> is a DOS error level to set.
  31.  *  $RETURNS$
  32.  *      NIL
  33.  *  $DESCRIPTION$
  34.  *      To safely quit the application.
  35.  *  $EXAMPLES$
  36.  *      GT_Quit(1)
  37.  *  $SEEALSO$
  38.  *
  39.  *  $INCLUDE$
  40.  *
  41.  *  $END$
  42.  */
  43.  
  44. #include "GT_LIB.ch"
  45.  
  46. FUNCTION GT_Quit(nErrorLevel)
  47.  
  48. LOCAL nError := MAX(FERROR(),DOSERROR())
  49.  
  50. Default nErrorLevel to 0
  51.  
  52. IF .NOT. (nError = 0 .OR. nError = 32)
  53.     // Message if error other than sharing violation
  54.     GT_Error('Last Error was ....')
  55. ENDIF
  56.  
  57. SET(_SET_PRINTER,'')
  58. GT_ShowCursor()
  59. SETCOLOR('W/N,N/W,N,N,N/W')
  60. DBCLOSEALL()
  61. SCROLL()
  62. @ 0,0 SAY ''
  63. ERRORLEVEL(nErrorLevel)
  64.  
  65. QUIT
  66. /*
  67.     End of GT_Quit()
  68. */
  69. RETURN(NIL)
  70.