SET ESCAPE

SET ESCAPE

Toggle Esc as a READ exit key

Syntax

      SET ESCAPE ON | off | <xlToggle>

Arguments

ON enables Esc as a READ exit key.

OFF disables Esc as a READ exit key.

<xlToggle> is a logical expression that must be enclosed in parentheses. A value of true (.T.) is the same as ON, and a value of false (.F.) is the same as OFF.

Description

If SET ESCAPE is ON, Esc terminates the current READ. Any changes made to the current Get object are lost, and validation with RANGE or VALID is bypassed. When SET ESCAPE is OFF and the user presses Esc, the key press is ignored. With SET KEY, however, you can reassign Esc for special handling, regardless of the status of SET ESCAPE.

Seealso

READ, READEXIT(), SETCANCEL(), SET KEY, SETKEY()

Advertisements

Harbour All Functions – S

SaveToken

SayScreen

Seconds
Secs

Select

Set

SetAtLike

SetDate

SetKey

SetMode

SetPrec

SetTime

SetTypeahead

Sign

Sin

SinH

Space

Sqrt

Str

StrDiff

StrFormat

StrSwap
StrTran
StrZero
SubStr

SET FUNCTION

SET FUNCTION

Assign a character string to a function key

Syntax

      SET FUNCTION <nFunctionKey> TO [<cString>]

Arguments

<nFunctionKey> is a number in the range 1..40 that represent the function key to be assigned.

<cString> is a character string to set. If <cString> is not specified, the function key is going to be set to NIL releasing by that any previous Set Function or SetKey() for that function.

Description

Set Function assign a character string with a function key, when this function key is pressed, the keyboard is stuffed with this character string. Set Function has the effect of clearing any SetKey() previously set to the same function number and vice versa.

      nFunctionKey    Key to be set
      ------------    ----------------------
         1 .. 12      F1 .. F12
        13 .. 20      Shift-F3 .. Shift-F10
        21 .. 30      Ctrl-F1 .. Ctrl-F10
        31 .. 40      Alt-F1 .. Alt-F10

SET FUNCTION command is preprocessed into __SetFunction() function during compile time.

Examples

      // Set F1 with a string
      CLS
      SET FUNCTION 1 TO "I Am Lazy" + Chr( 13 )
      cTest := Space( 20 )
      @ 10,  0 SAY "type something or F1 for lazy mode " GET cTest
      READ
      ? cTest

Compliance

Harbour use 11 and 12 to represent F11 and F12, while CA-Cl*pper useĀ 11 and 12 to represent Shift-F1 and Shift-F2.

Platforms

All

Seealso

Inkey(), SetKey(), __Keyboard()

hb_SetKeyGet()

HB_SetKeyGet()

Determine a set-key code block and condition-block

Syntax

      HB_SETKEYGET( <nKey> [, <bConditionByRef> ] )

Arguments

<anKey> is an numeric key value

<bConditionByRef> is an optional return-parameter

Returns

Current assigned action-block

Description

The HB_SetKeyGet() function returns the current code-block assigned to a key, and optionally assigns the condition-block to the return-parameter

Examples

      LOCAL bOldF10, bOldF10Cond
      bOldF10 := HB_SetKeyGet( K_F10, @bOldF10Cond )
      ... // some other processing
      SetKey( K_F10, bOldF10, bOldF10Cond )

Tests

      See test code above

Compliance

Harbour

Files

Library is rtl

Seealso

SETKEY(), HB_SETKEYSAVE(), HB_SETKEYCHECK()

hb_SetKeyCheck()

HB_SetKeyCheck()

Implements common hot-key activation code

Syntax

      HB_SetKeyCheck( <nKey> [, <p1> ][, <p2> ][, <p3> ] )

Arguments

<nKey> is a numeric key value to be tested code-block, if executed

<p1>..<p3> are optional parameters that will be passed to the code-block

Returns

True if there is a hot-key associated with <nKey> and it was executed; otherwise False If there is a hot-key association (before checking any condition): – if there is a condition-block, it is passed one parameter – <nKey> – when the hot-key code-block is called, it is passed 1 to 4 parameters, depending on the parameters passed to HB_SetKeyCheck(). Any parameters so passed are directly passed to the code-block, with an additional parameter being <nKey>

Description

HB_SetKeyCheck() is intended as a common interface to the SetKey() functionality for such functions as ACHOICE(), DBEDIT(), MEMOEDIT(), ACCEPT, INPUT, READ, and WAIT

Examples

      // within ReadModal()
      IF HB_SetKeyCheck( K_ALT_X, GetActive() )
         ... // some other processing
      ENDIF
      // within TBrowse handler
      CASE HB_SetKeyCheck( nInkey, oTBrowse )
         RETURN
      CASE nInKey == K_ESC
         ... // some other processing

Tests

      None definable

Compliance

Harbour

Files

Library is rtl

Seealso

SETKEY(), HB_SETKEYSAVE()