Skip to content

Field_Mask - DataDictionary

Provides the token characters for the mask for a table column

Type: Property
Access: Read/Write
Data Type: String
Parameters: None

Parameters

Parameter Type Description
iField Integer Number of the column in the table

Syntax

Property String Field_Mask
Access Type Syntax
Read Access: Get Field_Mask to StringVariable
Write Access: Set Field_Mask to StringVariable/Value

Description

Masking is discussed in more detail in Masks in Windows Applications.

Field_Mask provides the token characters for the mask for column iField. Any characters provided in this property for any mask type (defined in the Field_Mask_Type 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 ().

For non-data-bound control, use psMask instead of Field_Mask.

The token characters for Field_Mask_Type Mask_Numeric_Window and Mask_Currency_Window are:

Col 1 Col 2
, 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)

The token characters for Field_Mask_Type Mask_Window are:

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

The token characters for Field_Mask_Type Mask_Date_Window are:

Col 1 Col 2
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 Field_Mask_Type Mask_DateTime_Window are:

Col 1 Col 2
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 Form_MaskType & Field_Mask_Type Mask_Time are:

Col 1 Col 2
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 Field_Mask for the Price column in the OrderDtl table to display a typical currency format, including the Euro symbol.

Set Field_Mask of OrderDtl_DD Field OrderDtl.Price to "€,*0.00;-€,*0.00"

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 Field_Mask for the Price column in the OrderDtl table to display a typical currency format. Default_Currency_Symbol will be replace with the currency symbol from the Windows Regional mask setting.

Set Field_Mask of OrderDtl_DD Field OrderDtl.Price to (Default_Currency_Symbol()+",*0.00;-"+Default_Currency_Symbol()+",*0.00")

File and File_Field Interfaces

Many of the DataDictionary methods contain a two variants of the same message: Field_Message and File_Field_Message. For a complete description of these messages please refer to The Field and File_Field DD Interfaces.

The Field_ version of a message must use the keyword FIELD to identify the Table.Column name. The File_Field_ version must use the keyword FILE_FIELD to identify the Table.Column name. These should never be mixed!

// When using Field_ message use the FIELD keyword
Get Field_Mask Field Customer.Name to sMask

// When using the File_Field_ message use the FILE_FIELD keyword
Get File_Field_Mask of oCustomer_DD File_Field Customer.Name to sMask

See Also

File_Field_Mask | Defining Data Dictionary Field Attributes | Masked_Value