Returns the total width of the characters in an expression.
||A string expression
||Optional The numeric pitch value to use for full-width characters. The default is 2. Other permissible values are 1, 1.25, and 1.5. (These values with any number of trailing zeros are permissible.) All other pitch values result in a <FUNCTION> error.
is a DSM-J function available in ObjectScript. $ZWIDTH
returns the total width of the characters in expression
. The pitch
value determines the width to use for full-width characters. All other characters are assigned a width of 1 and are considered to be half-width.
$ZWIDTH can be abbreviated as $ZW in DSM-J mode. This abbreviation cannot be used in Caché mode.
Assume that the variable STR
contains two half-width characters followed by a full-width character:
In this example, the two half-width characters total 2. Adding 1.5 (the specified pitch value) for the full-width characters produces a total of 3.5.