
The INMODE command selects the input mode of the scripting language. The input mode tells the INPUT command where to get data from.
There currently defined input modes are:
-1: No input. The INPUT command is completely disabled
-2: Synchronous input from the current I/O interface. That means, INPUT blocks until all requested characters or a carriage return are received. e.g. for a string variable, INPUT returns when 256 characters or an CR arrived.
-3: Asynchronous input from the current I/O interface. In this case, INPUT doesn't wait. It returns until the requested number of characters have been read or there's no more data, whichever comes first.
Any valid and open file handle: INPUT then reads data from an open file, until the requested number of characters have been read, or the read pointer is at the end, whichever comes first.
The following example repeats all input until the user enters "stop":
outmode -2
inmode -2
do
input c$
if c$ = "stop" then
end
end if
print "you entered ";
print c$
loop
If INMODE is -2 or -3, the Command Execution Machine will be suspended until the BASIC program ends or INMODE switches to another mode. This must be done because the CMD machine would otherwise suck off all input. See also the OUTMODE command.