39
Remarks:
If the result of <expression> is not zero, the THEN or GOTO clause will be ex-
ecuted (GOTO is always followed by a line number). THEN may be followed by
either a line number for branching or one or more statements to be executed.
If the result of <expression> is zero, the THEN or GOTO clause will be ignored
and the ELSE clause, if present, will be executed. IF there is no ELSE clause,
execution will continue with the next executable statement.
INPUT Statement
Purpose:
To allow input from the keyboard during program execution
Format:
INPUT [;] [#<port>][<“prompt”>;]<variable>
[,<variable>]...
#<port> is the port number (1 or 2).
<“prompt”> is a message that will be displayed when the INPUT
statement is executed.
Examples: INPUT “DATA” : A$
INPUT #2, “DATA” , A$, B$
Remarks:
When an INPUT statement is executed, program execution pauses and a ques-
tion mark is displayed to indicate the program is waiting for data. If <“prompt”> is
included, the string is displayed before the question mark. The program will not
continue execution until the user has entered the required data.
A coma may be used instead of a semicolon after the prompt string to suppress
the question mark.
Data is not excepted by the INPUT statement until a carriage return is entered.
Therefore input can be edited with the backspace and delete keys.
When more than two variables are input, they must be delimited by a coma(s).
The data entered is assigned to the variables specified by the INPUT statement.
The number of values entered must be the same as the number of variables in
the INPUT statement.
The variable names in the list may be numeric or string variable types as well as
subscripted variables (array variable). The type of each entered data item must
agree with the type specified by the variable name.
Strings input to an INPUT statement need not be surrounded by quotation
marks.
Responding to INPUT with too many or too few items will cause an error mes-
sage to be displayed prompting the user to re-enter the data.
If a peripheral device other than TERM or COMU is selected by the OPEN state-
ment, neither the prompt statement nor “?” is displayed.
To eliminate “?” when COMU, etc., is selected by the OPEN statement, use the
LINE INPUT command.
The INPUT statement cannot be executed in direct mode. If the port number is
omitted, port 1 is assumed as the default port.
KEY(n) Statement
Purpose:
To enable, disable, or stop an interrupt invoked by key input and
defined by the ON KEY GOTO or ON KEY GOSUB statements
Format:
KEY(<n>) ON/OFF/STOP
<n> is the key number (1-8).
Example:
KEY(4) ON
Commands, Statements, and Functions
Summary of Contents for C500-ASC04
Page 1: ...C500 ASC04 ASCII Unit Operation Manual Revised February 2001 ...
Page 5: ...iv ...
Page 7: ...vi ...