
124
In the example below, the character "A" may be entered with the alphabet entry function
or may be generated by pressing the F1 key which has been assigned that character by
the
KEY statement. The user program, however, cannot distinguish between them so
as to transfer control to the program step labelled
FUNC1 in both cases.
K$=INPUT$ (1)
IF K$="A" THEN GOTO FUNC1 ENDIF
.
.
.
To prevent such a problem, assign any other character to the F1 key with the KEY
statement and then modify the judgement condition. For example, replace the charac-
ter assigned to the F1 key with the character "#", as shown below.
KEY 1, "#"
.
.
.
K$=INPUT$ (1)
IF K$="#" THEN GOTO FUNC1 ENDIF
.
.
.
For details, refer to Chapter 14, KEY and ON KEY statements.
Note that the alphabet entry function does not influence the keystroke trapping which
identifies keys according to their key numbers.
■
Alphabet Entry Example
Coding in a user program:
OUT 5,1 ’Activating the alphabet
’entry function
INPUT "data=";a$ ’Waiting for keystrokes
Entering alphabet characters "ND" under the above user program:
1) Press the trigger switch.
Komentáře k této Příručce