INK
I N K < i n k > , < c o l o u r > [ , < c o l o u r > ]
INK 0,1
COMMAND: Depending on the current Screen Mode (Chapter 5), a number of
IN K
s 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
I N K E Y ( < i n t e g e r e x p r e s s i o n > )
1 0 C L S : I F I N K E Y ( 5 5 ) = 3 2 T H E N 3 0 E L S E 20
2 0 CLS:GOTO 10
3 0 P R I N T " Y o u ' r e p r e s s i n g [S H I F T ] and V"
4 0 F O R t = l T O 1 0 0 0 : N E X T : G O T O 1 0
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
2 0 P R I N T " A r e y o u c l e v e r ( y o r n ) ? "
3 0 a $ = I N K E Y $ : I F a $ = " " G O T O 3 0
4 0 I F a $ = " N " O R a $ = " n " T H E N
P R I N T “ Y o u m u s t h a v e b e e n t o b u y m e ! " : E N D
5 0 I F a $ = " Y " O R a $ = " y " T H E N
P R I N T " Y o u ' r e t o o m o d e s t ! ! ! " : E N D
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
Содержание CPC464
Страница 1: ......
Страница 32: ...or you can type 3e1 1e1 ENTER 300 2 3000x1000 Type 3e3 1e3 ENTER 3000000 3 3000x0 001 Type 3e3 1e 3 ENTER 3 ...
Страница 102: ...PRINT 10 AND 12 Results in 8 PRINT 10 AND 1000 Results in 8 again ...
Страница 118: ...TO DO DRAW THIS PAGE ...
Страница 219: ...actual value may be made to vary during the execution of a program ...
Страница 240: ...Text and WINDOW planner Mode 2 80 Columns ...
Страница 241: ......
Страница 245: ...Sound envelope Music planner sheet ...