Display Masking

The Display mask is shown (in background mode) prior to entry. This display may be used to give the operator a better idea of what is to be entered.

The Display mask can be any string the developer wants displayed. No validation is performed prior to display.

Input Masking

The input mask controls the actual entry of information. The format for the input mask is similar to the INPUTE masking but allows more flexibility. The following is a table of valid masking characters:

Character

Accepts

X

Any printable character.

a

Any alphabetic character.

A

Any alphabetic character. Converts lower-case alphabetic characters to upper case.

0

Any digit.

U

Any digit, alphabetic, or punctuation character. Converts lower-case alphabetic characters to upper case.

z

Any digit or alphabetic character.

Z

Any digit or alphabetic character. Converts lower-case alphabetic characters to upper case.

Output Masking

The output mask is used to better format the display of the field contents. The following is a table of valid masking characters:

Character

Effect on data

#

Numeric formatted, space filler.

0

Numeric formatted, zero filler.

*

Numeric formatted, asterisk filler.

,

If "," found before ".", this is a thousands separator. If "," found after ".", this is a decimal point indicator.

.

If "." found before ",", this is a thousands separator. If "." found after ",", this is a decimal point indicator.

(

To show negative in ().

)

To show negative in ().

C

Show "CR" if negative.

c

Show "CR" if negative or "DR" if positive.

-

Show "-" if negative.

+

Show "-" if negative or "+" if positive.

Y

Date format %Yd (e.g., 1996).

y

Date format %Yz (e.g., 96).

M

Date format %Md (e.g., 9).

m

Date format %Mz (e.g., 09).

D

Date format %Dd (e.g., 1).

d

Date format %Dz (e.g., 01).

Example

The following uses all three masks with the entry of a date:

CALL "_lkeymap.utl"
LET BBEXT$=STBL("BBEXT")
DIM INPUT$:STBL("!INPUT.TPL")
LET INPUT.COL=10,INPUT.ROW=5,INPUT.LENGTH=6
LET INPUT.DMASK$="MMDDYY"
LET INPUT.IMASK$="NNNNNN"
LET INPUT.ARG$="n"
LET INPUT.OMASK$="00/00/00"
CALL BBEXT$+"_ninput.utl",INPUT$,VAL$,CTLVAL

The result is a dimensioned display of: MMDDYY, forcing entry of numeric values in the form: NNNNNN. After entry, the output would be: MM/DD/YY.

In normal input, a numeric value is considered any digit from 0 to 9 and "+,-". In a date entry (or phone number), only numeric digits should be entered. In this situation, the input data should be validated.

The output mask does not validate input data. If the output mask fails, the input routine exits without an error and does not change input data.