$ZWRite()
$ZWRite()
Converts its first string argument to or from ZWRITE format (quoted graphics characters concatenated with $CHAR() representations of any non-graphic characters). The second integer expression controls the direction of conversion. The format of the $ZWRITE() function is:
$ZWRITE(expr[,intexpr])- The first argument specifies the string to convert to or from the ZWRITE format.
- The second argument specifies the direction of conversion. When intexpr is not specified or evaluates to zero, $zwrite() converts the first argument to the ZWRITE format. When intexpr evaluates to a non-zero value, $ZWRITE() treats the first argument as being in ZWRITE format and attempts to convert it to a string with embedded non-graphic characters; if it is not in ZWRITE format, it returns an empty string.
- Converting to zwrite format tends to produce a string that is longer than the input and therefore a $ZWRITE() result may exceed the maximum string length - the maximum input length that is guaranteed not to do so is a 116,510 byte string.
- If all its arguments are literals, $ZWRITE() evaluates to a literal constant at compile time.
- Note that non-graphic characters differ between M mode and UTF-8 mode.
Example:
GTM>set temp="X"_$char(10)_"X" ; $CHAR(10) is the linefeed character
GTM>write temp
X
X
GTM>write $zwrite(temp)
"X"_$C(10)_"X"
GTM>write $zwrite($zwrite(temp),1)
X
X
GTM>