The :READ command can be used to request user input. Together, the optional input check and input handling parameters can be used to:
- determine the type of UI control that will be displayed (e.g., a text field or a combo box)
- in the case of combo boxes, determine the choices displayed in the menu
- in the case of number controls, determine the range of numbers that can be chosen
- validate user input, limiting what values an input field will accept
Here are some examples.
|Input Check||Input Handling||Type of UI control displayed||Validation performed on field contents (allowed input)|
|00||K||Text||No validation of input; any Latin-1 character may be entered.|
|00||Text||Letter characters must be uppercase.|
|YYYYMMDD||Text||Any date in the format YYYYMMDD (See: time & formats)|
|0-9,A-F||Text||Any number between 0 and 9, or any letter between A and F|
|5-10||Text||Between 5 and 10 characters|
|5-10||N||Number||Any number between 5 and 10|
|'A-1','B-2'||Menu||Either the string A-1 or the string B-2|
|A,B,C,1,2,3||Menu||Any character in the set A,B,C,1,2,3|
|A,B,C,1,2,3||O||Combo box||Any character, either from the menu, or typed in manually|
Does anyone know of other combinations? Specifically, are there ways to do any of these things?
- Additional control types
- Additional types of input validation
- ranges that includes negative numbers
- ranges of times, dates, or timestamps
This question originates in the discussion Generate input dialog box dynamically from prompt set object.