Get array of keys redirected via the SetKey() or SET KEY


     FT_SetKeys() --> aKeyValues




    An array from 0 to n elements, where n is the number of keys that
    have been redirected via SetKey().  Each element in the array contains
    the Inkey() value of a key that has been redirected.


    Nantucket encourages Clipper programmers to write modular code -- black
    boxes that do not modify any global settings without resetting them
    on exit.  In the past, this has proven cumbersome where SetKey() is
    concerned, because the only way to see if a key had been redirected
    was to call SetKey() and see if it returned NIL or a code block.  To
    check every possible key value was unacceptably slow.

    This function attempts to alleviate this problem by returning an array
    that contains only those keys that have been redirected.  It is
    substantially faster than the method mentioned above because it
    directly accesses Clipper's internal table of redirected keys.

    Some highly unorthodox programming techniques, not to mention rather
    strange use of Clipper internals, was necessary to make this function
    work.  If this makes you uncomfortable, then don't use this function,
    you snivelling coward.


    local aKeys := FT_SetKeys()    // Get the key table
    local aBlox := {}              // Create a parallel array
    local i

    for i := 1 to len( aKeys )
      // Nullify all redirections, while saving code block
      // for later restoration

      aadd( aBlox, setkey( aKeys[ i ], NIL )

    // Do some stuff

    for i := 1 to len( aKeys )
      // Restore the redirections

      setkey( aKeys[ i ], aBlox[ i ] )


 Author: Ted Means


One response to “FT_SETKEYS

  1. Pingback: FT Keyboard-Mouse | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.