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

Syntax:     KEYREAD()

Returns:    A character string.

Usage:      Those characters that have been processed by Clipper, but
            are still in the keyboard buffer, may be copied to a string
            using this function.  KEYREAD() provides a facility to look at
            the "history of keystrokes" and thereby establish what the
            user has performed up to present during the execution of the
            program.  This could be used, for instance, to provide a
            facility for repeating certain actions.

            This function can be very useful when searching for errors.

Note:       All the keys processed by the program since the last
            execution of SET TYPEAHEAD or KEYSEND() are returned.
            Characters already in the buffer, but which have not yet been
            read by the Clipper program via an input instruction, will be
            ignored by KEYREAD().

            If the keyboard buffer is empty then the function will return a
            null string, e.g., at the start of the program or after executing
            a KEYSEND().

            KEYREAD() uses its own key codes (which differ from those
            of the Clipper functions) for manipulating the keyboard.  This
            allows all keys to be distinguished.  These codes consist of
            two bytes per key.  The first byte (ASCII-1) corresponds to
            the code of the key concerned.  The second byte (ASCII-2)
            supplies information to distinguish whether an ASCII code or
            special code has been read.  The value for ASCII-2 will
            always be 0 if the ASCII code for a key, or a key
            combination has been read from the keyboard.  In all other
            cases, a 1 is returned for ASCII-2.

Library:    CT1.LIB


--------------------------------- Example ------------------------------

Examples:   sequence = CHR(117) + CHR(1)     && The code for
                                             && inputs preceding
            history = KEYREAD()              && Ctrl-End

            IF RIGHT(history,2) = sequence
               ? "You have left MEMOEDIT() with Ctrl-End."
            ENDIF



See Also: DSETTYPE() KEYSEND()

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