psMask - cWebBaseDEO

The mask string for this control

Type: Property (Web Property)

Access: Read/Write

Data Type: String

Parameters: None

Syntax
 { WebProperty=Client }
 Property String psMask

Web Property Read Access: WebGet psMask to StringVariable
Web Property Write Access: WebSet psMask to StringVariable/Value

Read Access: Get psMask to StringVariable
Write Access: Set psMask to StringVariable/Value


Description

The psMask property provides support for data masking.

This mask is used for display, and in edit mode if peDataType is set to typeASCII.

For data types (peDataType) other than typeASCII, psMask is not used while a control is in edit mode (has the focus). In edit mode, it uses the psTimeFormat which can be set in the cWebApp object.


You should set peDataType explicitly for psMask to work as intended.

Set psMask to manually assign a mask to the text displayed by the control. For more information on valid mask strings, see Field_Mask.

If the control has a data binding (Entry_Item), then data masking is automatically set according to the DataDictionary rules (Field_Mask.

Without a data binding, you have to set piPrecision and piMaxLength for numeric controls.

To use a specific mask (in conjunction with a specific peDataType or not), see psMask.
If you use typeNumber and want to use decimal places, make sure you set piPrecision, since it defaults to 0.

Sample

Set peDataType to typeNumber
Set psMask to "##.##"
Set piPrecision to 2



The token characters for mask type typeNumber 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)
Zsuppress zeros

The token characters for mask type typeASCII are:

# any numeric digit (0-9)
@ any alphabetic character
! any punctuation character
* any single printable character

The token characters for mask type typeDate are:

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

The token characters for mask type typeDateTime are:

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

The token characters for mask type typeTime are:

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



Euro Symbol Sample

This sample shows how to set the psMask to display a typical currency format, including the Euro symbol.

set peDataType to typeNumber
Set psMask to "&euro,*0.00;-&euro,*0.00"
Set piPrecision to 2


Default_Currency_Mask

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.

Sample

This sample shows how to set the psMask for a currency control to display a typical currency format. Default_Currency_Symbol will be replace with the currency symbol from the Windows Regional mask setting.

set peDataType to typeNumber
Set psMask to (Default_Currency_Symbol()+",*0.00;-"+Default_Currency_Symbol()+",*0.00")
Set piPrecision to 2


About Web Properties
Each web property maintains two values: The regular property value is set during object creation and should not be changed during the lifetime of that object. To access that value, use the standard property Get and Set syntax.
The web property value is the local value stored at each client. This is synchronized to the client's local value whenever a server call is being processed. To access the web property value, use the WebGet and WebSet syntax above instead of the standard Get and Set syntax.