Previous Topic

Next Topic

Inhoudsopgave

Book Index

Isah Script Input Masks

Description

An input mask, or field template, allows you to specify the required input format of values entered in a field. The input mask consists of a number of literal characters that together with special characters determine the kind of value that can be entered into the blank in that position. Defining an input mask makes data entry easier and controls the values users can enter.

The input masks are primarily used in Text and Date/Time fields. You can, however, also use them for Number or Currency fields. For example, you could create an input mask for a phone numbers field that requires that you enter exactly enough numbers to make up a Dutch area code and telephone number, and that a user can only enter numbers in each blank.

Defining Input Masks

The input mask definition can contain up to three sections separated by semicolons (;). For example, the following specifies an input mask for a text box control used for entering a phone number:

calcedit.mask = "(###) # ### ###"

Section

Meaning

First

The input mask itself. For a list of characters you can use to define the input mask, see the next table.

Second

Determines whether to store the literal display characters:

 

0

Store literal characters with the value entered.

 

1 or blank

Store only characters entered in blanks.

Third

Specifies the character that is displayed for the space where a user should type a character in the input mask. You can use any character; type " " (double quotation marks, space, double quotation marks) to display a space. If you leave the third section blank, the underscore ( _ ) is used.

Valid Input Mask Characters

You can use characters as specified below in the first section of the mask:

Character

Description

!

Causes optional characters to be shown as leading spaces. If this character does not appear in the mask, optional characters are shown as trailing spaces.

>

Causes all following characters to be converted to upper case.

<

Causes all following characters to be concerted to lower case.

<>

Causes the use of upper case characters as specified by the user to be valid.

\

Causes the character that follows to be displayed as a literal character. Used to display any of the special characters to be used as literal characters (for example, \L is displayed as just L).

L

Letter (a through z, A through Z, entry required).

l

Letter (a through z, A through Z, entry optional).

A

Alphanumeric character (a through z, A through Z, 0 through 9, entry required).

a

Alphanumeric character (a through z, A through Z, 0 through 9, entry optional.

C

Any character or a space (entry required).

c

Any character or a space (entry optional).

0

Number (0 through 9, entry required).

9

Number (0 through 9, entry optional).

#

Number (entry optional; plus (+) and minus (-) signs also allowed).

:

Time separator for separating hours:minutes:seconds. (The character specified in the regional settings in the Windows Control Panel, Regional Settings supersedes this value).

/

Date separator for separating months/days/years. (The character specified in the regional settings in the Windows Control Panel, Regional Settings supersedes this value).

;

Mask section separator.

_

Places a space in the text. If the user types a character in this position, the cursor jumps over the _ character.

Any character not present in the table above may appear in the first part of the mask as literal characters. Literal characters must match precisely when the field is entered. These characters are inserted automatically and the cursor jumps over them when you are typing. The special characters above can also be used in this way if they are preceded by \.