Please enable JavaScript to view this site.

A-Shell Reference

[ Type code =  f  ]

If the type code  f  is specified, setdef is used to specify a "form" (or "masked input") using the following special characters:

9 matches any digit

A matches any alphabetic character

X matches any character

Anything else is a "form background" character, which magically appear in the field when the field gets to the required size, and the cursor jumps over them as you type.

Examples

(999) 999-9999      (North American telephone number)

99-XXX-99           (e.g. 05-Feb-09)

Comments

The form characters will appear automatically within the field as needed, and cannot be moved by the user, thus both simplifying and enforcing data entry rules. However, they are not returned with the field data (unless you add +8 to the opcode).
In text mode, the form characters will appear even in an empty field, but in GUI mode, they do not appear until required by the number of characters entered. (This is because GUI mode usually involves proportional text, and since proportional spaces are so narrow, the form characters would probably initially confuse users.) If you want the entire form to be apparent at the start of entering a field, you may want to pre-fill it with (non-space) filler characters, such as "0" or "X".
Any characters entered must satisfy both the form characters and the type codes, so generally you would use type * (all characters accepted) and rely on the form characters to further limit it.
If xmin is shorter than the form length, the user will not be required to enter the remaining characters. For example, an extended zip form of "99999-9999" would allow an entry of "12345" if xmin <= 5.
As of 5.1.1200, forms may be used with date fields, although the form must contain only two separator characters and they must be in the 3rd and 6th position of the form, which must otherwise contain all 9's. (For example, "99/99/99" and "99-99-9999" are acceptable, but " 99 - 99 - 99" would not be, because of the extra spaces.)