Mask

Applies to

EditMask controls

Description

The Mask property controls the characters the user can enter in the control and also the formatting of the characters. You must use special characters to define the mask, depending on the mask type defined with the MaskDataType property.

PowerBuilder supports four kinds of display formats:

Characters that do not have special meaning for the format appear as is in the EditMask control.

For more information about using each kind of display format, see Chapter 4, “About Display Formats and Scrolling.” For more information about defining display formats, see the PowerBuilder User’s Guide.

Usage


In a painter

StepsTo specify an edit mask:

  1. Display the Mask tab page of the control’s Properties view.

  2. Select the mask datatype from the MaskDataType drop-down list.

  3. Type the mask characters in the Mask field, or click the right arrow at the end of the Mask field and select one or more of the mask character examples displayed in the pop-up menu.

    The pop-up menu examples change based on the mask datatype you selected in the MaskDataType list.


In scripts

The Mask property takes a string value and can be used to obtain the value of a mask. It cannot be used to set the value.

The following example uses the SetMask function to set the datatype and string format for a mask, and then uses the Mask property to obtain the value of the string format:

string ls_mask

em_1.SetMask(StringMask!, '@@@,@@')
ls_mask = em_1.Mask