A mask is a specified pattern to which data must conform to be accepted, making data entry faster and more accurate. Use masks to validate and format data as it is entered into character fields. Masks are especially helpful when entering various types of codes or identification numbers such as telephone numbers, social security numbers, and invoice numbers into character fields. For example, if you track sales slips that always begin with a letter followed by three numbers, you might use the mask a### to ensure all entries start with a lowercase letter followed by three numbers.
Masks can also prevent users from entering the wrong kind of data. For example, a zip code mask could prevent users from entering letters instead of numbers. For example, you might always want telephone numbers entered with parenthesis around the area code, a space after the area code, and a hyphen after the first three numbers:
The mask for this would be:
Each "0" represents a number. The open and closing parenthesis, the space after the closing parenthesis, and the hyphen, are literal characters in the template that will be entered in the field during data entry.
In the Control Panel select the table and click Table > Edit Field Rules.
Display the Field Types tab.
Select a Mask Style. The options are:
"No mask" - the default
"Conditional masks" - You can define one or more conditional masks for a field. For example, you can define a different template and mask for each country. A U.S. ZIP code might be 01803-2801, while a Canadian postal code might be M5T 2T9.
If you selected "Simple mask" in step 3:
1. Optionally, enter a mask pattern into the Mask field. A mask is a pre-defined string containing mask characters and template characters. Mask characters accept data (see the Mask Character Table below); template characters are fixed and cannot be edited during data entry.
2. Optionally, click the 'up' button to display the Input Mask dialog and select a predefined mask.
If you selected "Conditional masks" in step 3:
Enter a mask into the first row of the Mask column of the embedded browse.
Enter a condition expression into the first row of the Condition column. The condition must evaluate to TRUE (.T.) or FALSE (.F.). Click to use the Expression Builder to help you define the expression.
You may add up to fifteen additional expressions on subsequent rows of the embedded browse. During data entry, Alpha Anywhere evaluates conditional expressions in the order you enter them. It uses the mask of the first expression that evaluates to TRUE (.T.).
Optionally, check Do not store mask literals in field. You may want to do this to shorten table fields and index entries. For a phone number field with the following template:
Values such as "(617) 555-1131" and "(617) 555-1097" are normally stored. With Do not store mask literals in field enabled, the values "6175551131" and "6175551097" are stored instead.
Optionally, change the default Place Holder Character "_". This is the character that the user sees and which represents character positions that can accept input.
Use the following mask characters to define a mask.
- Mask Character
Any uppercase letter
Any digit, sign or decimal
Any uppercase letter, digit, sign or decimal
Any letter, digit, sign or decimal
Any uppercase letter or digit
Any letter or digit
Any character following \ is taken as a literal, or template character.
When entering data that completely fills a field, such as typing a 2-letter state abbreviation, you can automatically move to the next field without having to press ENTER. This saves time when entering large amounts of data. To set the field to advance automatically, click the Auto Advance after field filled check box.