INPUTIF

Top  Previous  Next

 

The INPUTIF statement takes input from the keyboard type-ahead buffer or the data queue, if available.

 

Format

 

INPUTIF var {, length {, fill}} {_} {:} {modes}

{THEN statement(s)}

{ELSE statement(s)}

 

INPUTIF @(x, y) {,} {:} var {, length {, fill}} {_} {:} {modes}

{THEN statement(s)}

{ELSE statement(s)}

 

where

 

x, yare the screen position (column and line) at which input is to occur.

 

varis the variable in which the data is to be stored.

 

lengthis the maximum number of characters to be allowed.

 

fillis a Pick style fill expression. The first character will be used to fill any spare space in the input field to make the field width clear to the user. The second character will be used to fill unused space after input is completed. If the fill string is only one character, spaces will be used. The third character, if present causes the cursor to be left at the end of the input field instead of the default action of leaving it after the last character of the entered data string. The fill option cannot be used with HIDDEN.

 

modesare any combination of the following keywords:
HIDDENechoes characters back to the screen as asterisks for password type fields.
NO.ECHOSuppresses echo of input data.
NO.ENCODINGSuppresses decode of encoded input when the terminal is set to operate in UTF-8 mode. Use of this mode will also suppress encoding of data echoed back to the terminal.
RAWCauses INPUT to place input data into var without special interpretation of newline, backspace, etc. Used in this way, the length element of the statement must be present.
UPCASEconverts input data to uppercase.

 

At least one of the THEN and ELSE clauses must be present. If there is no keyboard type-ahead and the data queue is empty, the ELSE clause is executed.

 

See the INPUT and INPUT@ statements for details of input editing.