• K E Y f u n c t i o n
This function is used to read one character into the character variable by pressing one
key during program execution. This function is different from an INPUT statement and
does not stop in an input await condition (" ? " display). Even when there is no key
input, program execution will proceed sequentially.
Format: character variable = KEY
A$. $, etc. are used for the character variable.
Example:
10 A$=KEY
20 IF A$= ^A' THEN 100
30 IF A$= '*8' THEN 200
4 0 I F A $ = T H E N 3 0 0
50 GOTO 10
This program shows the data input using the KEY function and a portion of the
distribution. However, a determination will be made using the IF statements whether
the character data read by the KEY function on line 10 was input or not. Using the
KEY function, even if the HQ Key is not pressed, the first key input only will be read.
However, since program execution will not stop as it does when using an INPUT
statement, an input await condition is achieved by incorporating the following IF
statements.
The IF statements on lines 20 through 40 are judgement commands and perform
distribution using character variables which were input using the KEY function. For
details concerning IF statements, refer to page 48.
5-6-2 Output Command
• P R I N T s t a t e m e n t
A PRINT statement is used to display the calculation result or data. It displays the
character string, contents of the variable and calculation result following the command.
» * 1
Format: PRINT CSR numerical expression
character expression
Either one of the items enclosed in || can be used.
Items enclosed in ( lean be omitted.
-45-