HTBasic Help
×
Menu
Index

INPUT

Inputs numeric or string data from the keyboard.
 
 INPUT ["prompt",] item [, ["prompt",] item ...]
 
Usage:
INPUT A,B$,C(4),D
INPUT Parray(*)
INPUT "",Str$[1;10]
INPUT "Xcoor=",X,"Ycoor=",Y
INPUT "Enter 4 numbers",Y(1),Y(2),Y(3),Y(4)
 
Example:           INPUT.BAS
 
Description:
The INPUT statement gets information from the user's terminal. The optional prompt string or a question mark (?) is displayed on the CRT display line. The computer then waits until a reply is entered from the keyboard and either CONTINUE or ENTER is pressed to enter a line of input. To suppress the prompt, specify a prompt string of "".
 
Numeric variables can be simple scalar variables, full array variables, or subscripted array elements. String variables can be simple string variables, array variables, string array elements or sub-strings. An array may be entered in row major order using the full array specifier, "(*)". Complex numbers are entered in rectangular form, first the real part and then the imaginary part.
 
Leading and trailing spaces are ignored. Data values may be entered individually or multiple values may be entered at once. If multiple values are entered, separate each value with a comma. If too many values are entered, the extra values are ignored. Both quoted and unquoted strings are allowed. Commas are not allowed in unquoted strings, but may appear in quoted strings. To embed one quotation mark in a quoted string, type in two quotation marks at the place you wish one to appear.
 
Two consecutive commas cause the corresponding variable to retain its old value. Terminating an input line with a comma or pressing CONTINUE or ENTER without entering any data retains the original values for all remaining variables in the list.
 
Live keyboard operations are not allowed while INPUT is waiting for data. ON KBD, ON KEY and ON KNOB events are disabled during INPUT.
 
See Also: