613-518-1166 info@zimdatabases.com

ZIM Language Reference

Output Masks

< All Topics

Output masks are employed to format the output of fields, form fields, and data values in output operations. The MASK format option in Zim Reports specifies an output mask pattern for a report item. The $mask function specifies an output masking pattern to be applied to fields, form fields, and data values and returns a character string with the result of the masking operation. The Field Mask attribute defines the expected output format of a field’s data value when it is printed or listed in Zim Reports, or by the list or output commands.   Mask patterns used with any of the three options described above are constructed in the same manner using the same set of available characters. However, the set of characters available varies according to the data type of the item being masked. For more information on mask patterns and their relation to data types, see Masking.

Selected Examples of Mask Patterns for Numbers

In the following examples, leading or trailing spaces are indicated by / in the Output column.

Output of Sign Placeholders

Sign Placeholder Output When Masked Value <0 Output When masked Value >=0
‘-‘ /
‘+’ +
‘CR’ CR //
‘DB’ DB //
‘)’ ) /
‘(‘ ( /

Behaviour of Fixed Text Characters

Output Mask Pattern Item Value Output
‘ZZ/ZZZZ’ 1234 ///1234
‘ZZ/ZZZZ’ 12345 /1/2345
‘Z9/ZZZZ’ 1234 /0/1234
‘***,***’ 999 ****999

Behaviour of Float Characters

Output Mask Pattern Item Value Output
‘$$$,$$9.99CR’ 1324.77 /$1,324.77//
‘$$$,$$9.99CR’ -56.88 ////$56.88CR
‘$$,$$9.99DB’ -2566.44 $2,566.44DB
‘$$,$$9.99DB’ .00 /////$.00//
‘$,$$9.99+’ 1324.77 1,324.77+
‘$$$9.99+’ -56.88 /$56.88-
‘(((9,999,99)’ -1324.82 //(1,324.82)
‘((ZZ,999.99)’ -386.41 //( 386.41)
‘$.$$’ 0.00 ////
‘($$,$$9.99)’ -56.88 ///($56.88)
‘($$,$$9.99)’ -5.2 ////($5.20)
‘+$$,$$$.99’ -56.88 ///-$56.88
‘+$$,$$$.99’ 2562.55 +$2,562.55

Mask Patterns and the Language Customizer

Certain characters inserted into the output value by a mask are defined internally in the software. The Language Customizer (ZIMLANG) administrative utility is used to redefine the internal characters and strings used by the software in a variety of circumstances, such as output masks.

 

For example, the currency placeholder $,  is by default the dollar sign $. However, it can be redefined to output other symbols, such as the Euro sign , the pound sign  £, etc. To achieve this, the Language Customizer can redefine the currency symbol output by the currency placeholder.

 

When using the Language Customizer to edit the software’s internal characters and strings, note the following:

  • In application programs, output masks are always specified using the standard mask pattern characters. This rule applies to mask patterns specified in reports, in field and form field definitions, and in the $mask function.
  • In user interface displays and output, the characters output by a mask pattern are determined by the software’s internal values.

For example, in Zim application programs, the dollar sign $ is universally used as the currency placeholder. However, the currency symbol output by the placeholder depends on the current language customization (if any).

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?

Submit a Comment

Your email address will not be published. Required fields are marked *

Table of Contents