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>keysec()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
KEYSEC()

Syntax:     KEYSEC([<char>[,<expN1>][,<expN2>][,<expL>])

Arguments:  <char> denotes the key code  to be entered into the
            keyboard buffer.
            <expN1> denotes the time in seconds after which the
            character will be placed in the keyboard buffer.  Negative
            values correspond to multiples of 1/18.2 seconds.
            <expN2> denotes how many times the function is to operate;
            -1 denotes unlimited.
            <expL> stipulates whether the internal time counter will start
            again from the beginning (.T.) ot not (.F.) after a key is
            pressed.  The default value is (.F.).

Returns:    A logical value.
            The function will return the value (.T.) when the desired
            character has been placed in the keyboard buffer after the
            specified time.

Usage:      This function can be used, for example, to produce demo
            programs relatively  easily.  In conjunction with KEYSEND(), it
            possible to simulate almost any keyboard input with a
            specific time delay.  Like KEYTIME(), KEYSEC() can also be
            used for key traps in conjunction with SET KEY.  It is
            therefore possible to write the data in the DOS buffer to the
            hard disk automatically at fixed time intervals during a
            GET...READ.  The function will uninstall itself when the
            character has been placed in the keyboard buffer the number
            of times specified by <expN2>.

Notes:      If <expL> is (.T.), the time counter will be reset each time a
            key is pressed.  To uninstall, simply call the function without
            any arguments.

Warning:    You must uninstall the function whenever you quit the
            application, or if you use the Expanded Driver supplied with
            Clipper Tools One, it is automatically uninstalled.  The
            function changes one of the interrupt vectors, and the system
            will eventually crash if the function is not uninstalled when
            you quit the application, since the old interrupt vectors will
            not be restored.

            It is only possible for one time monitor to be active since a
            new KEYSEC() will deactivate the previous one.

Library:    CT1.LIB


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

Examples:   * Place CHR(7) every 5 seconds for a
            * count of 3.
            ? KEYSEC(7,5,3)                     && (.T.)

            * Place CHR(255) in the keyboard buffer
            * every 60 seconds.
            ? KEYSEC(255,60,-1)                 && (.T.)

            * The internal counter will start again from
            * the beginning as soon as the key is pressed.
            ? KEYSEC(255,60,-1,.T.)             && (.T.)



See Also: KEYTIME() LASTKFUNC() LASTKLINE() LASTKPROC()

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