Top  Previous  Next


The IN statement reads a single character from the terminal with an optional timeout.





IN var {FOR timeout {THEN statement(s)} {ELSE statement(s)}}




varis the variable to receive the input character value. This is the character code point value, not the character itself.


timeoutis the timeout period in tenths of a second.



The IN statement reads a single character from the terminal, returning the character value in var. Unless the character is a non-printing control code, it is echoed to the terminal. On Windows console sessions, the special keys return values in the upper half of the 8-bit character set as defined in the KEYS.H include record in the SYSCOM file. The KEYINV() function should be used instead of IN if it is necessary to distinguish these keys from the characters that are defined to have the same code point values.


If a timeout is specified, the program will continue execution if no input is received after this period. The var will be set to zero if a timeout occurs.


The optional THEN and ELSE clauses can be used with the timeout to determine whether input was received.



See also: