HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

6-: 4
Variable Assignment during Interactive Input
When you press RETURN, the INPUT statement assigns the values to the
variables specified by the input list. The first value input is assigned
to the leftmost variable in the input list, the second value to the next
variable, and so on.
If you type more values than the number of variables listed in the input
list, the INPUT statement ignores the extra values. If you type fewer
values than the number of variables listed in the input list, the INPUT
statement prompts you for more values until values have been assigned to
all variables. If the input list contains an array reference, you must
input one value for each array element. If a user prompt is not
specified for the additional variables requiring values, the prompt is
??.
If you input a value that cannot be assigned to its corresponding
variable; for example, you input a string for a numeric variable, the
INPUT statement reprompts you. Assignments to preceding variables are
not affected.
Job Stream Input
This section explains how the INPUT statement reads input when HP
Business BASIC/XL is running in a job stream. The input for an input
statement in a jobstream is either included in the stream file or
obtained from a file specified by a redirection of the interpreter's
input. The method of redirecting the interpreter's input is discussed at
the beginning of chapter 2. Here, we discuss the method for including
the input for INPUT statements in a stream file. The records in the job
stream file immediately following the command that begins program
execution are used to satisfy the input items for the INPUT statement.
The values in the stream file are separated by commas, semicolons, or EOR
marks. HP Business BASIC/XL suppresses prompts specified in any prompt
option in an INPUT statement when HP Business BASIC/XL is running a
stream job.
Variable Assignment during Job Stream Input
The INPUT statement assigns the values in the job stream file to the
variables specified in the input list. The first value in the stream
file record is assigned to the leftmost variable in the input list, the
second value to the next variable, and so on.
If the record in the stream file has more values than the number of
variables in the input list, the additional values are ignored. If the
record has fewer values than the input list needs, HP Business BASIC/XL
reads the next record to find additional values. If records or values
are not found, an error occurs. If the input list contains an array
reference, the record must contain one value for each array element.
Colons in the INPUT statement save unassigned input values or use input
values saved from previous INPUT statements.
If a value in the input file record cannot be assigned to its
corresponding variable, HP Business BASIC/XL aborts the program. This
occurs if the record contains a string value that is to be assigned to a
numeric variable.
If numeric values are expressed in the format in which a comma is the
radix indicator, then input values must be separated with semicolons or
EOR marks.
The rules for string input from a job stream file are the same as the
rules for string input during an interactive session from a terminal.
Unformatted Output
This section explains how to produce unformatted output on an output
device:
* Unformatted output statements that have one of the following
characteristics: