CODE | KEY NAME | ||||
3 | Null character | ||||
58-68 | Function keys, F0-F10 | ||||
71 | Home | ||||
72 | Cursor up | ||||
73 | Page up | ||||
75 | Cursor left | ||||
77 | Cursor right | ||||
79 | End (or Home down) | ||||
80 | Cursor down | ||||
81 | Page down | ||||
82 | Insert | ||||
83 | Delete |
10 n = 0 20 n = n + 1 30 print "Type 'x' to stop this program" 40 print n; 50 a$ = inkey$ : if a$ = "x" then stop 60 goto 20Line 50 shows the use of inkey$. When the user finally types x, the program terminates. Notice that the character is not echoed to the display (as with input).
As an illustration, the program in the example above will behave differently if BASECHO is set when the program is executed: the messages in lines 30 and 40 will each be printed once, and the program will block at line 50 awaiting a line of input. After a line of input has been entered, the call to inkey$ will unblock. For each character of input preceding x, the character will be echoed and one circuit of the loop will occur causing the messages in lines 30 and 40 to each be printed once. The program will terminate when it reads the input character x, but will leave unread any characters following the x, including the terminating newline character.
from The Basmark QuickBASIC Programmer’s Manual by Lawrence Leinweber