next up previous contents index
Next: Some examples of usage: Up: Receiving input from the Previous: Receiving input from the   Contents   Index

Interact with the keyboard

Currently, text can be accepted from the user during program execution mainly via 3 primitives: key?, readchar and read.

key?: is read as true or false according to whether a key has been pressed or not since the start of program execution.

readchar:
If you are uncertain about the value returned by a key, you can type:
pr readchar. The interpreter will then wait for you to type on a key before giving you the corresponding value.

read list_title word: Presents a dialogue box whose title is list_title. The user can then input a response in a text field, and the response will be stored in the form of a word or a list (if the user wrote several words) in the variable :word, and will be evaluated when the OK button is pressed.


next up previous contents index
Next: Some examples of usage: Up: Receiving input from the Previous: Receiving input from the   Contents   Index
Loïc 2008-06-08