InputMask describes the acceptable characters that can be entered by the user, or formats fields and memory variables for output. It is the controls' equivalent of the PICTURE clause used with @ ... GET input, and recognizes the same options:
|
InputMask character |
Meaning |
|
A |
Alphabetic characters only |
|
L |
Logical: Allows and displays uppercase and lowercase characters T, F, Y and N |
|
N |
Alphabetic and numeric digits only |
|
X |
Any character—alphabetic, numeric, symbols |
|
Y |
Allows Y,y,N,n for logicals; displays uppercase only |
|
# |
Allows digits, signs and spaces |
|
9 |
For character data: allow entry of digits only. For numeric entry: same as #, above |
|
! |
Converts alphabetic to uppercase |
|
$ |
Displays dollar sign |
|
$$ |
Floating dollar sign, flush against number |
|
. |
Displays correct SET POINT value separating whole number from decimal |
|
, |
Displays correct SET SEPARATOR value used to separate thousands |
InputMask defines each character of a field; if you want three uppercase characters, you must specify "!!!". This is in contrast to the Format property, which need be specified only once and applies to the entire field. Because Format and InputMask share many of the same letters, this often leads to confusion. When expressed in a single command, such as a SAY clause or the TRANSFORM() function, FORMAT properties are distinguished by being preceded with an @ symbol.
SET POINT TO ","
SET SEPARATOR TO "."
SET CURRENCY TO " mk"
SET CURRENCY RIGHT
* The next line displays "$ 12.345,00" — wrong!
? TRANSFORM(12345, "$ 999,999.99")
* This next example works correctly using the $ Format.
? TRANSFORM(12345, "@$ 999,999.99") && DISPLAYS "12.345,00 mk"
* An input field for Social Security numbers, and the variable
* only stores 9 digits, saving the space wasted with the hyphens
ThisForm.txtSSN.Format = "R"
ThisForm.txtSSN.InputMask = "999-99-999"@...Get, Format, Transform(), Set Currency, Set Point, Set Separator
