
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FORCE Data Base Compiler - ##############################################################################
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
##############################################################################
###+-----------------+########################################################
#+-| CLEAR TYPEAHEAD |-------------------------------------------------+######
#| +-----------------+ The CLEAR TYPEAHEAD clears the keyboard buffer. |######
#+---------------------------------------------------------------------+######
##############################################################################
##############################################################################
#+--| Syntax |-------------+##################################################
#| CLEAR TYPEAHEAD |##################################################
#+-------------------------+##################################################
##############################################################################
##############################################################################
######+---| Description |---------------------------------------------+#######
######| The FORCE runtime library contains a keyboard buffer seperate |#######
######| from other hardware buffers. CLEAR TYPEAHEAD clears both the |#######
######| BIOS and FORCE buffers. |#######
######+---------------------------------------------------------------+#######
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Clear the keyboard buffer prior to WAITing |#########
#########| * for a string. |#########
#########| |#########
#########| CLEAR TYPEAHEAD |#########
#########| WAIT "Do you really want to? " TO yes_no |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Remove any keys "stuffed" into the keyboard buffer. |#########
#########| |#########
#########| k = lastkey() |#########
#########| KEYBOARD "RCA television" + chr(13) |#########
#########| IF k = &K_ESC |#########
#########| CLEAR TYPEAHEAD |#########
#########| ENDIF |#########
#########| {...} |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also: ACCEPT @...GET INPUT WAIT inkey() keyboard key_int()
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson