Casio PB-100 Instruction Manual page 46

Table of Contents

Advertisement

• K E Y f u n c t i o n
Thi s f u nct i o n i s used t o read one charact e r i n t o t h e charact e r vari a bl e by pressi n g one
key duri n g program executi o n. Thi s functi o n i s di f ferent from an INPUT statement and
does not stop i n an i n put awai t condi t i o n (" ? " di s pl a y). Even when there i s no key
input, program execution will proceed sequentially.
Format: character variable = KEY
A$. $, etc. are used for the character variable.
Example:
1 0 A $ = K E Y
2 0 I F A $ = ^ A ' T H E N 1 0 0
30 IF A$= '*8' THEN 200
4 0 I F A $ = T H E N 3 0 0
5 0 G O T O 1 0
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 functi o n on l i n e 10 was i n put or not. Usi n g 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
s t a t e m e n t s .
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.
- 4 5 -

Advertisement

Table of Contents
loading

Table of Contents