IN

Top  Previous  Next

 

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

 

 

Format

 

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

 

where

 

varis the variable to receive the input character value. This is the ASCII character number, not the character itself.

 

timeoutis the timeout period in tenths of a second.

 

 

The IN statement reads a single byte from the terminal, returning the character value in var. Unless the character is a non-printing control code, it is echoed to the terminal.

 

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:

INPUT, KEYIN(), KEYREADY()