Property String psMask
| Read Access: | Get psMask to StringVariable |
| Write Access: | Set psMask to StringVariable/Value |
The psMask property provides the token characters for the mask. Any characters provided in this property for any mask type (defined in the peDataType property) for which they are not token characters will be repeated in the displayed values literally. Token characters can be displayed literally by preceding each with a backslash (\).
The year is not required for dates in the current year. For example, when entering "12/12", the value is changed to 12/12/2017.
You should set peDataType explicitly for psMask to work as intended.
Default is "".
CreateCurrencyMask provides a quick way to create a currency column.
CreateNumericMask provides a quick way to create a numeric column.
The token characters for mask type Mask_Numeric_Window and Mask_Currency_Window are:
| , | comma inserts local thousands' separator every three places to the left of the decimal |
| . | period is replaced with the local decimal indicator |
| ; | semi-colon comes after format for positive quantities, before format for negative numbers |
| # | no digit or one digit |
| * | any number of digits, including none |
| 0 | one digit, or a 0 (zero) |
| Z | suppress zeros |
| # | any numeric digit (0-9) |
| @ | any alphabetic character |
| ! | any punctuation character |
| * | any single printable character |
| m | month 1 - 12 |
| mm | month 01 - 12 |
| mmm | local abbreviation for month Jan - Dec |
| mmmm | local name for month January - December |
| d | day 1 - 31 |
| dd | day 01 - 31 |
| ddd | local abbreviation for day of week Sun - Sat |
| dddd | local name for day of week Sunday - Saturday |
| yy | 00 - 99 |
| yyyy | 1700 - 2900 |
| / | diagonal is replaced with the local date separator |
| m | month 1 - 12 |
| mm | month 01 - 12 |
| mmm | local abbreviation for month Jan - Dec |
| mmmm | local name for month January - December |
| d | day 1 - 31 |
| dd | day 01 - 31 |
| ddd | local abbreviation for day of week Sun - Sat |
| dddd | local name for day of week Sunday - Saturday |
| yy | 00 - 99 |
| yyyy | 1700 - 2900 |
| / | forward slash is replaced with the local date separator |
| hh | hour 00-23 |
| mm | minute 01-59 |
| ss | second 01-59 |
| f | fractions of second, displayed with a minimum of 1 digit, 0-999 |
| fff | fractions of second, displayed with 3 digits, 000-999 |
| : | colon is replaced with the local time separator |
| h | hours in 1 digit (0-11 or 0-23, depending on ap) |
| hh | hours in 2 digits (00-11 or 00-23, depending on ap) |
| mm | minutes in 2 digits (00-59) |
| ss | seconds in 2 digits (00-59) |
| ap | if present, show in 12 hour format with AM/PM; if not present, show in 24 hour format |
Default_Currency_Mask is a global string (which you may change). The default mask is:
(Default_Currency_Symbol + ",*;(" + Default_Currency_Symbol + ",*)"where the Default_Currency_Symbol is obtained from the current Windows User's Regional Settings and, due to the *, the number of digits after the decimal point defined by the table column's precision.
This sample shows how to set the psMask to display a typical currency format. Default_Currency_Symbol will be replaced with the currency symbol from the Windows Regional mask setting.
Set psMask to (Default_Currency_Symbol()+",*0.00;-"+Default_Currency_Symbol()+",*0.00")
Masks support zero-suppression for numbers, dates and strings. Zero-suppression is enabled by inserting a "Z" as the first character of the form mask. The "Z" must be the first character and it must be capitalized. Note that suppression is only applied to forms when they do not have the focus.
When applied to numeric and currency masks, the form will be cleared if its value is zero.
Set Form_DataType to Mask_Currency_Window Set psMask to "Z$,#######.00;($,#######0.00)"
When applied to a date mask, the form will be cleared if its value is zero (previously the form would appear as " / / ").
Set Form_DataType to Mask_Date_Window Set psMask to "ZM/d/yyyy"
When applied to a string mask, the form is cleared if the value is blank. Technically, this is not zero suppression but blank suppression.
Set Form_DataType to Mask_Window Set psMask to "Z(###)###-####"
Also see Zero Suppression in Data Dictionaries.