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

  1. /*
  2.     File......: GT_AskQuit.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_ASKQUIT()
  23.  *  $CATEGORY$
  24.  *      General
  25.  *  $ONELINER$
  26.  *      Ask the user if they would like to quit
  27.  *  $SYNTAX$
  28.  *      GT_AskQuit() -> lQuited
  29.  *  $ARGUMENTS$
  30.  *      None
  31.  *  $RETURNS$
  32.  *      lQuited
  33.  *  $DESCRIPTION$
  34.  *      Ask the user if they would like to exit the program,
  35.  *      and quit if they do.
  36.  *  $EXAMPLES$
  37.  *  $SEEALSO$
  38.  *
  39.  *  $INCLUDE$
  40.  *
  41.  *  $END$
  42.  */
  43.  
  44. #include "GT_LIB.ch"
  45.  
  46. FUNCTION GT_AskQuit()
  47.  
  48. LOCAL nLastKey := LASTKEY()
  49.  
  50. //  Ask
  51. IF UPPER(CHR(GT_AskUser('Exit Program ? (Y/N)', ;
  52.     {ASC('N'),ASC('Y'),ASC('n'),ASC('y')}))) = 'Y'
  53.  
  54.     // Said yes
  55.     GT_Quit()
  56.  
  57. ENDIF
  58.  
  59. //  Reset Keyboard
  60. KEYBOARD CHR(nLastKey)
  61. INKEY()
  62.  
  63. /*
  64.     End of GT_AskQuit()
  65. */
  66. RETURN(.F.)
  67.  
  68.