Table of Contents

Advertisement

6-2 Program Commands
KEY$
®
Function:
Enters one character from the keyboard.
Explanation:
1) Accepts the input of only one character from the keyboard.
2) Numerals, alphabetical
letters
and symbols can be input.
3) The data entered will be in single character form.
4) Null will occur when there is no key input.
5) Since "?" is not displayed and input waiting also does not occur, KEY$ is
usually used in combination with an
IF
statement.
*KEY$
can be abbreviated as
KEY.
Example:
1 0
20
30
40
50
60
70
80
PR I NT''BEEP";
A$=KEY$
IF
A$="0"THEN BEEP
IF
A$="1"THEN BEEP
IF
A$="E ''THEN
70
GOTO 20
PR I NT: PR I NT" END''
END
Repeated until the (I] key
is pressed.
*A
low sound
will
be generated when the
~
key is pressed and a high sound
will be generated when the
IIJ
key is pressed. "END" will be displayed and the
program will be
terminated
when the
w
key is pressed.
113

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents