![]() ![]() |
|
INThe IN statement allows the program to receive raw data from the input device, which is normally the terminal keyboard, one character at a time.
COMMAND SYNTAXIN Var {FOR expression THEN|ELSE statements}
SYNTAX ELEMENTSVar will be assigned the numeric value (0 - 255 decimal) of the next character received from the input device. The statement will normally wait indefinitely (block) for a character from the keyboard. Specifying the FOR clause to the IN statement allows the statement to stop waiting for keyboard after a specified amount of time. The expression should evaluate to a numeric value, which will be taken as the number of deci-seconds (tenths of a second) to wait before abandoning the input. The FOR clause must have either or both of the THEN or ELSE clauses. If a character is received from the input device before the time-out period then Var is assigned its numeric value and the THEN clause is executed (if present). If the input statement times out before a character is received then Var is unaltered and the ELSE clause is executed (if present).
NOTES
EXAMPLES
|