
7-6
Section
Details of BASIC Commands
163
input
Syntax:
INPUT
[;] [# <port expression>,][<prompt> (; | ,)]<variable> {, <variable>}
Description:
Statement. Accepts input to a specified variable or variables during program execution.
<port expression> is an expression returning an integer in the range: [1… 3]. If the <port
expression> is omitted, the terminal port’s port number is the default (port #1 for the ASC11/21 or
port #3 for the ASC31).
<prompt> is an optional text string that is output to the terminal to prompt for the input. If the
prompt is followed by a semi-colon then a ‘?’ will be appended, this can be suppressed by using a
comma after the prompt string. If the port specified is not configured as a “TERM” or a “COMU”
port then the prompt and the ? will be suppressed. (When the ? is not to be displayed for a
“COMU” port, use the LINE INPUT statement.)
Strings input to the
INPUT
statement need not be surrounded by quotes.
The <variables> specified to receive the input can be any valid variable name. The number of
values entered must be the same as the number of variables specified in the
INPUT
statement and
the type of each value entered at the prompt must correspond to the types of the variables
specified in the
INPUT
statement. Otherwise, a “NO SUPPORT” error (code 0064) will result.
Input is terminated by a carriage return.
Multiple values can be input by separating them by commas.
Remarks:
Note:
1.
If the port expression is not specified the terminal port is default.
2.
Port #3 corresponds to the terminal port of the ASC31.
3.
If Port #3 is specified on the ASC11 or ASC21, an “ILLEGAL FUNCTION CALL”
error (code B005) will result.
4.
Execution of the BASIC program will be paused and the BASIC LED indicator on
the front of the Unit will flash slowly until the <CR> code is input.
5.
If an interrupt occurs while the INPUT statement is waiting for an input and the
interrupt is not disabled or stopped, the interrupt subroutine will be processed
immediately. Program execution will resume from the INPUT command when the
interrupt subroutine has been completed.
6.
If a semi-colon is added after the INPUT, the cursor will remain on the same row
after input.
7.
When the terminator section of the receive data is CR + LF, only CR will be
accepted as the INPUT statement, so LF will remain in the receive buffer.
Examples:
> 10 INPUT “ENTER YOUR NAME : “, A$
> 20 PRINT “HELLO “;A$
> 30 END
> RUN
ENTER YOUR NAME : FRED <CR>
HELLO FRED
See also:
LINE INPUT
,
WAIT
Summary of Contents for C200H-ASC11
Page 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Page 2: ...iv...
Page 4: ...vi...