Display mask overwriting data

By: Luke Dickman

Abstract: the display mask is overwriting my data

Question:

I want to display my data in the dbSwing and/or JBCL components using a display mask. However, when I enter my data, the display mask replaces some of my sting data with the literals that are specified in the mask.

For example: I want to enter the following phone number:

4085557777

and have it displayed as:

(408) 555-7777

However, when I specify the following display mask:

'('000') '000'-'0000

my data is displayed as:

(085) 777-

or something similar to it. Is there a way to display the data as I want to see it?


Answer:

Yes. You need to set your display mask to the following:
'('000') '000'-'0000;0;0

and you should also set your edit mask to the following:
'('000') '000'-'0000;0


Here's how it works:
When using text patterns with masks in Data Express, the patterns are separated into four different arguments:

1. the mask

2. a zero or one (0 or 1) to indicate weather the literals added to the data by the mask should or should not be saved with the data. Leaving this space blank defaults to 1, or save the literals

3. the character to be used as a "blank" character indicator, telling the user at runtime which spaces need to be filled with data.

4. The character to be used to replace blank positions in the output. If this position is omitted, blank spaces are stripped away.

The only required argument is, obviously, the first. If you want to make use of an additional argument, you must separate each argument with a semicolon.

To skip a particular argument, place a semicolon in each apropriate position, but leave blank the value for the unwanted argument. For example, if you want to use the first and third arguments, but not the second or the fourth, you would have something like this:

<mask>;;<value_for_third_argument>

Server Response from: ETNASC03