INK
INK <ink>,<colour>[,<colour>]
INK 0,1
COMMAND: Depending on the current Screen Mode (Chapter 5), a number of INKs are available.
The colour, or colours, used for an INK may be changed by an INK command, according to the table
of colour values in Appendix IV.
Associated keywords: PEN, PAPER
INKEY
INKEY(<integer expression>)
10 CLS:IF INKEY(55)=32 THEN 30 ELSE 20
20 CLS:GOTO 10
30 PRINT "You're pressing [SHIFT] and V"
40 FOR t=l TO 1000:NEXT:GOTO 10
FUNCTION: This function interrogates the keyboard to report which keys are being pressed. The
keyboard is scanned at 1/50 sec. The function is particularly useful for spotting Y/N responses, since
the state of shift is not required according to one of the interpretation options. The above example
detects when [SHIFT] and V are pressed together. Shift and control are identified according to
Value returned [SHIFT] [CTRL] KEY
-1 ? ? UP
0 UP UP DOWN
32 DOWN UP DOWN
128 UP DOWN DOWN
160 DOWN DOWN DOWN
Associated keywords: INPUT,INKEY$
INKEY$
INKEY$
10 CLS
20 PRINT "Are you clever (y or n) ?"
30 a$=INKEY$: IF a$="" GOTO 30
40 IF a$="N" OR a$="n" THEN
PRINT “You must have been to buy me!":END
50 IF a$="Y" OR a$="y" THEN
PRINT "You're too modest!!!":END
60 GOTO 20
FUNCTION: Reads a key from the keyboard to provide operator interaction without hitting
[ENTER] after every answer. If there is a key pressed, then the function responds - if no key is
pressed, it continues to return an empty string which is used to loop until a valid input is detected
for processing.
Associated keywords: INPUT, INKEY