INPUT [ HP Transact Reference Manual ] MPE/iX 5.0 Documentation
HP Transact Reference Manual
INPUT
Prompts for a value and places it in the input register.
Syntax
INPUT "prompt-string"[,option-list];
INPUT generates a prompt that requests a user response. Usually the
value input as a response to prompt-string is tested by a subsequent IF
statement. The response can be used to programmatically change program
flow during execution. Transact upshifts all entered values. The value
returned by INPUT cannot be displayed or moved. Thus, INPUT is useful
mainly to test a user response. To save or display a user response, you
should use another verb, such as DATA or PROMPT, that transfers the
response to an item defined in your program.
Statement Parts
prompt-string The prompt that appears on the user's terminal. It
must be enclosed within quotes.
option-list One or more of the following options separated by
commas:
BLANKS Does not suppress leading blanks
supplied in the input value.
NOECHO Does not echo the input value to the
terminal.
STATUS Suppresses normal processing of "]"
and "]]", which cause an escape to a
higher processing or command level.
Status Meaning
Register
Value
-1 User entered a "]".
-2 User entered a "]]".
-3 User entered one or more blanks and
no non-blank characters.
-4 If timeout is enabled with a
FILE(CONTROL) statement, a timeout
has occurred.
> 0 Number of characters (includes
leading blanks if BLANKS option is
specified); no trailing blanks are
counted.
The STATUS option allows you to
control subsequent processing by
testing the contents of the register
with an IF statement.
Examples
This example shows a typical use of the INPUT verb. INPUT accepts a user
response, and then the IF statement tests for a particular value of this
response.
INPUT "DO YOU WISH THE REPORT ON THE LINE PRINTER?";
IF INPUT = "Y", "YES" THEN
DO
SET(OPTION) PRINT;
DISPLAY "LINE PRINTER SELECTED FOR OPTION PRINT";
DOEND;
MPE/iX 5.0 Documentation