Format: INPUT var list or INPUT "string" var list
Supported by: COMX BASIC V1.00, Floating Point BASIC 2.2, Pecom 32 BASIC, Pecom 64 BASIC 1.0 and 4.0, Quest Super BASIC 1.4, 3.0, 5.0 and 6.0, RCA BASIC3 V1.1, Telmac SBASIC v 24.3
Similar commands: -
When BASIC encounters an input statement, it stops and issues a question mark "?" to the screen as a prompt. It then waits for a user response. A list of variable names may appear after the INPUT statement. Each of the variable names must be separated by a comma. In response to the prompt "?", the user may answer with any expression or group of expressions separated by commas. If the INPUT statement has three variable names after it and the user responds with only two expressions, BASIC will issue another prompt (?) and wait for the third expression. Conversely, if the INPUT statement has only one variable name and the user responds with two or more expressions, BASIC will continue execution. When it encounters another INPUT statement it will pick up the last unused expression without issuing another prompt. It will continue to do so until all the unused inputted data is used up. Then, at that time, another prompt "?" will be issued. The data that is picked up is assigned to the associated variable name as it is inputted. The mode of the variable name defines the mode in which the associated input expression will be evaluated.
Note that an INPUT statement may not contain both string variable names and normal variable names at the same time. Furthermore, each INPUT statement containing a string variable name can contain one name. Because of this limit, in response to an INPUT A$ statement, the programmer can answer with a string of characters with no quotation marks. The carriage return marks the end of the string. The following are acceptable INPUT statements.
10 INPUT A, B, C (1) 10 INPUT A (1), A (B) 10 INPUT A$ 10 INPUT B$ (B)The following are incorrect INPUT statements.
10 INPUT AB (no delimiter between variables) 10 INPUT A$, B$ (multiple string names forbidden)
When the optional 'string' parameter is used the string test is printed prior to the question mark prompt. No delimiter or separator is used before the first quote or after the last quote.