Directives
INPUT Get Input from Terminal
   
Format INPUT [EDIT] ([chan][,fileopt])varlist
 
Where:
chan Channel or logical file number of the file from which to get terminal input.
fileopt Supported file options (see also, File Options):
BSY=stmtref Traps Error #0: (Input timeout)
ERR=stmtref Error transfer
HLP=string$ Help message identifier
IND=num Position cursor to specified column number.
LEN=num Limit on input size
SIZ=num Number of characters to read (number of screen columns)
TBL=stmtref Data translation table
TIM=num Maximum time-out value in integer seconds.
stmtref Program line number or statement label to which to transfer control.
  When screen positions are tight, you can combine the LEN= and SIZ= options to have ProvideX supply a scrolling input field. For example, to allow a user to enter 60 characters in a field where you only have room for 30 on the screen:

INPUT (0,LEN=60,SIZ=30)"Name....:",N$

varlist Comma-separated list of variables, literals, Mnemonics, IOL= options, and/or location functions '@(...)'. Include Format Masks to filter data being received.
   
Description Use the INPUT directive to issue prompts and to receive input from a terminal device. You would normally use the logical file number to refer to a terminal. Input from the user is stored in a variable specified. ProvideX treats any literals or expressions included in the statement as prompts. When a numeric variable is specified, numeric data must be received. Non-numeric input in response to a numeric variable (other than commas and decimals) will cause an Error #26: Variable type invalid.

If you use the EDIT clause, the current values for the variables are loaded into the input buffer so that the user can edit them.

Use a format mask with the INPUT directive to control the input. To do this, append a colon and the mask to the given variable in varlist. If you omit a format mask for a numeric in an INPUT statement, the 'DP' Decimal Point Symbol and 'TH' Thousands Separator system parameters are ignored for European decimal settings.

If an INPUT EDIT statement has both a format mask and a validation list, make sure that the validation list contains only entries that are possible. For example, if the format mask indicates that the input value must be a single character, do not use a null ("") value in the validation list.

Instead, valid input for "no value" could be a blank / space in this instance, as in:

0030 INPUT EDIT (0,ERR=0030)@(10,10),VAR$:"A":("Y"=0040,"N"=0050,""=0060)

A validation list may contain literals, simple variables, or substringed variables in PxPlus. ProvideX is limited to strictly literal values in the validation list.

Use the IND= option to set the position of the cursor in the INPUT field. Use IND(chan) to obtain the position where the cursor was left after the INPUT.

   
See Also ACCEPT Read Single Keystroke
OBTAIN Get Hidden Terminal Input
'ME' Mnemonic
'BI' Mnemonic
Data Format Masks .
   
Examples

0010 INPUT 'CS',@(5,5),"Enter customer number:",C ...
0100 INPUT EDIT "Enter value:",INV_AMT:"$##,##0.00"

Use IND=X as a parameter for the INPUT statement to set the starting point in an input field. For example, to start the input at the tenth character of A$:

-> A$="Now is the time"
-> INPUT EDIT (0,IND=10) A$

Use IND(0) to find out the character position where the user terminated input. For example, if the user enters "Now is the time", and presses Home and Tab the cursor moves to the 10th position, just after the "e" in "the". Then, if the user presses Enter or any other function key to terminate the input, the value returned in IND(0) is 10.