Radio Shack TRS-80 PC-3 Owner's Manual page 174

Table of Contents

Advertisement

FUNCTIONS
Pseudovariables
Pseudovariables are a group of functions which take no argument and are used like simple variables wherever required.
1 INKEY$
INKEY$ is a string pseudovariable which has the value of the last key pressed on the keyboard. Enter, CL, CA, SHIFT, DEF,
Up Arrow, Down Arrow, Left Arrow, and Right Arrow all have a value of NUL. INKEY$ is used to respond to the pressing of
individual keys without waiting for the ENTER key to end the input. For example, these statements "wait" for a non-NUL key to
be pressed:
10 A$
=
INKEY$
20 B
=
ASC INKEY$
30 IF B
=
0 THEN GOTO 10
40 IF B ....
Lines 40 and beyond contain tests for the key and the actions to be taken. On first executing the program, the value of INKEY$
is NUL, since the last key pressed was
(ENTER)
.
If IN KEY$ is used following PR INT or PAUSE, the contents of the display are
read instead of a key pass.
174

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents