| Directives |
|
| Format | INPUT
[EDIT] ([chan][,fileopt])varlist Where:
|
|||||||||||||||||||||||||||
| 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:
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 |
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$:
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. |
|||||||||||||||||||||||||||