Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Grumpfish Library 3.2 - <b>ginkey()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
GINKEY()

    As you are probably aware, INKEY() is not a wait state.  This has
    caused Clipper programmers untold grief down through the ages (well,
    at least since 1985 or thereabouts).  Fortunately, Clipper 5.0 makes
    it very easy to make INKEY() into a wait state, which brings us to
    GINKEY().

    Syntax

    GINKEY( [ <waittime> ] [, <variable>] )

    Optional Parameters

    <waittime> is a numeric representing how many seconds to wait for a
    keypress.  This value can be specified in increments as small as
    one-tenth of a second.  If you specify a zero, the program will wait
    for the next keypress no matter how long it takes.  Like INKEY(), you
    can call GINKEY() without a parameter, in which case GINKEY() will
    not wait for a keypress.  However, in most instances you will
    probably want to use this parameter.

    <variable> is an expression of any type.  If you pass this and the
    next keypress triggers a hot-key routine, <variable> will be passed
    as the third parameter to your hot-key routine.  If you do not pass
    this, the dummy variable name ("GINKEY") will be passed as the third
    parameter.

    For example, the Grumpfish APICK() function uses the <variable>
    parameter to pass the number of the currently highlighted array
    element.  This allows you to design context-specific help screens
    for each element of the array.

    Return Value

    As with INKEY(), GINKEY() returns an integer numeric value ranging
    between -39 and 386, which will be the value of the keypress.  If
    the keyboard buffer is empty, GINKEY() will return zero.  For
    specifics as to these values, please refer to your Clipper manual.

    Notes

    If it receives a keypress, GINKEY() will poll the key using the
    Clipper SETKEY() function.

    Sample Usage

    keypress := inkey(0)  // old way         
    keypress := ginkey(0) // new way         

    // perform this loop until ESC is pressed
    do while ginkey() != K_ESC               
       // whatever                           
    enddo                                    

See Also: GINKEYTIME()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson