$FUNCNAME$
  SETCANCEL()
$CATEGORY$
  TERMINAL/IO
$SUMMARY$
   Toggle Alt+C or Ctrl+C and Ctrl+Break as program termination keys
$LANG_RU$
    Alt-C  Ctrl+C    .
$SYNTAX$
     SETCANCEL([<lToggle>]) --> lCurrentSetting
$LANG_RU$
     SETCANCEL([<>]) -->  
$ARGUMENTS$
     <lToggle> changes the availability of Alt+C and Ctrl+Break as
     termination keys.  Specifying true (.T.) allows either of these keys to
     terminate an application and false (.F.) disables both keys.  The
     default is true (.T.).
$LANG_RU$
     <> -    Alt-C   
     .   - "" (.T.) 
      Alt-C   ,   - ""
     (.F.) - .      ""
     (.T.).
$RETURNS$
     SETCANCEL() returns the current setting as a logical value.
$LANG_RU$
     SETCANCEL()       .
$DESCRIPTION$
     SETCANCEL() is a keyboard function that toggles the state of the
     termination keys, Alt+C and Ctrl+Break, and reports the current state of
     SETCANCEL().  Use SETCANCEL() when you want to suppress a user's ability
     to terminate a program without using the specified method.

     Note that if Alt+C or Ctrl+Break is redefined with SET KEY, the SET KEY
     definition takes precedence even if SETCANCEL() returns true (.T.).

     Warning!  When SETCANCEL() has been set to false (.F.), the user
     cannot terminate a runaway program unless you provide an alternative
     escape mechanism.
$LANG_RU$
     SETCANCEL()     , 
          Alt-C  ,
              
      Alt-C.

     SETCANCEL()    ,    
         .  ,
      Alt-C     SET KEY,  SET
     KEY      ,  SETCANCEL() 
      "" (.T.).

     :
      SETCANCEL()   "" (.F.), 
        ,     
      .
$EXAMPLES$
       This example provides an escape route from a wait state with
	SETCANCEL() set off:

	#define K_ALTC   302
	//
	SETCANCEL(.F.)              // Disable termination keys
	SET KEY K_ALTC TO AltC      // Redefine Alt-C
	.
	. <statements>
	.
	RETURN

	FUNCTION AltC
	   LOCAL cScreen, nChoice, cLastColor := ;
		 SETCOLOR("W/B, N/G")
	   //
	   SAVE SCREEN TO cScreen
	   @ 6, 20 CLEAR TO 9, 58
	   @ 6, 20 TO 9, 58 DOUBLE
	   @ 7, 26 SAY "Alt-C: Do you want to quit?"
	   @ 8, 35 PROMPT " Yes "
	   @ 8, 41 PROMPT " No "
	   MENU TO nChoice
	   SETCOLOR(cLastColor)
	   RESTORE SCREEN FROM cScreen
	   //
	   IF nChoice = 1
	      QUIT
	   ENDIF
	   //
	   RETURN NIL
$LANG_RU$
        ,     
           (.F.)  SETCANCEL():

       #define K_ALTC 302
       //
       SETCANCEL(.F.)               //   <Alt>-<C>
       SET KEY K_ALTC TO AltC       //  <Alt>-<C>
       ...
       ...<>
       ...
       RETURN

       FUNCTION AltC
	  LOCAL cScreen, nChoice, cLastColor := SETCOLOR("W/B, N/G")
	  //
	  SAVE SCREEN TO cScreen
	  @ 5, 20 CLEAR TO 9, 58
	  @ 6, 20 TO 9, 58 DOUBLE
	  @ 7, 26 SAY "Alt-C:    ?"
	  @ 8, 35 PROMPT "  "
	  @ 8, 41 PROMPT "  "
	  MENU TO nChoice
	  SETCOLOR(cLastColor)
	  RESTORE SCREEN FROM cScreen
	  //
	  IF nChoice = 1
	     QUIT
	  ENDIF
	  //
	  RETURN NIL
$SEEALSO$
  SETKEY()
$END$
