INPUT

INPUT {#ch | prompt,} var {,var2 ... varn}

expects commas to delimit the input data into fields. If the data stream does not appear to satisfy the number of destination variables specified, it will prompt for more. The input stops when all the variables have been satisfied, which may be mid-line.

INPUT LINE {#ch | prompt,} var

inputs up to a line terminator, assigning the entire result to the one var.

INPUT RAW #ch, var

inputs a number of bytes of raw data equal to the physical size of the specified destination var.

INPUT CSV #ch, var {,var2 ... varn}

similar to the standard INPUT but is better at tokenizing the input according to the common industry standards for comma separated values.

Parameters

ch is an integer expression specifying the file channel on which the file was opened.

prompt is a string expression specifying the prompt to display on the screen for the case of keyboard input.

var, var2, ... varn are numeric or string variables to receive the input. Except for INPUT RAW, you may use dynamic strings (s,0) which will be expanded as needed to contain the input data.

Comments

If the file channel is not specified, or evaluates to zero, the operation inputs from the keyboard, in which case the optional prompt may be specified to instruct the operator what to input, e.g.:

INPUT "Enter your name: ", NAME$

INPUT "", NAME$

 

If no prompt is specified, a "?" will appear to prompt the user. You can specify a null prompt as in the second example above to eliminate the "?".