
Commands - 61
INPUT
Statement
SYNTAX: INPUT [#n,][;] var [,var] .....
INPUT [#n,][;] "prompt message"; var [,var] .....
INPUT [#n,][; ] "prompt message", var [,var ].. .. .
PURPOSE: The INPUT statement causes the program to pause and prompt an operator for input data.
REMARK S: The prompt message is a question mark in the first syntax. The other two syntaxes specify a
message string to be pr inted befor e the question m ark. No question mar k is printed if a comma is
used in place of a semicolon after the prompt message.
When the INPU T statement is followed immediately by a semicolon (the [;] option), the carriage
return is suppressed after the last variable.
The variables may be both numeric and string. The data you enter at the prompt m ust match the
variable type. Strings do not require the use of quotation marks. If a string is entered when a
numeric variable is required, a < Redo> error is given and all the variables must be reentered.
When multiple variables are used, separate the input data with commas. If fewer variables are
entered than specified with the INPUT statement, a '??' prompt will be given for the remainder.
The only editing you can do on an input line is the backspace. You can abort the INPUT statement
by executing < CTL-C> , which will also stop the program.
Even though the ser ial ports accept any char acter fr om 0 to 255, the INPUT statement filter s these to
the 32 to 127 ASCII set.
When the # is specified, n is the source number. For exam ple #2 is COM2. If the # is omitted, the
default is COM1.
Be careful when using this statement on boards with a watchdog timer. Unless the input is already
there (in the serial buffer) or the external device is quick, the watchdog is likely to reset. Also,
multi-tasking routines (such as ON TICK, ON INP) are not executed while INPUT is active.
RPC-2350 NOTE: The CAM BASIC statement BIT 128,4, 0 may need to be executed before you
will receive any characters. This command enables the CTS line to the sender.
RELATED: none
EXAMPLE: 10 INPUT "Input pH, volume";PH,VO
RUN
Input pH, volume? _
ERROR: none
Comentários a estes Manuais