Contains current I/O device OPEN parameters.
Examples
The following example uses $ZMODE to return the parameters of the current device:
WRITE !,"The current OPEN modes are: ",$PIECE($ZMODE,"\")
WRITE !,"The NLS collation is: ",$PIECE($ZMODE,"\",2)
WRITE !,"The network encoding is: ",$PIECE($ZMODE,"\",4)
The following example sets parameters for the current device with the USE command. It checks the current parameters with $ZMODE before and after the USE command. To test whether a specific parameter was set, this example uses the $PIECE function with the backslash delimiter, and tests for a value using the Contains operator ([). (See Operators.):
Zmodetest
WRITE !, $ZMODE
IF $PIECE($ZMODE,"\")["S" {
WRITE !, "S is set" }
ELSE {WRITE !, "S is not set" }
USE 0:("":"IS":$CHAR(13,10))
WRITE !, $ZMODE
IF $PIECE($ZMODE,"\")["S" {
WRITE !, "S is set" }
ELSE {WRITE !, "S is not set" }
QUIT
USER>DO ^zmodetest
RY\Latin1\K\UTF8\
S is not set
SIRY\Latin1\K\UTF8\
S is set