Skip to main content

Variables

Variables

If expression is a variable, ZWRITE writes varname=value on a separate line. The variable can be a local variable, process-private global, global variable, or object reference (OREF).

ZWRITE ignores undefined variables. It does not issue an error. If you specify one or more undefined variables in a comma-separated list of variables, ZWRITE ignores the undefined variables and returns the defined variables. This behavior allows you to display multiple variables without checking to determine if all of them are defined. If you specify an undefined variable to WRITE, ZZDUMP, or ZZWRITE InterSystems IRIS issues an <UNDEFINED> error.

Variables can be subscripted. If the variable has defined subnodes, ZWRITE writes a separate varname=value line for each subnode in subscript tree order. When you specify a root node, ZWRITE displays all of its subnodes, even when the root node is undefined.

You can use extended global reference to specify a global variable not mapped to the current namespace. ZWRITE displays extended global references even when the RefInKind()Opens in a new tab method of the %SYSTEM.ProcessOpens in a new tab class or the RefInKindOpens in a new tab property of the Config.MiscellaneousOpens in a new tab class has been set to strip extended global references. If you specify a nonexistent namespace, InterSystems IRIS issues a <NAMESPACE> error. If you specify a namespace for which you do not have privileges, InterSystems IRIS issues a <PROTECT> error, followed by the global name and database path, such as the following: <PROTECT> ^myglobal,c:\intersystems\iris\mgr\. For further information on subscripted variables and extended global reference, refer to Formal Rules about Globals.

Non-Display Characters

ZWRITE displays all printable characters. It displays non-printable characters using the $CHAR function, representing each non-printable character as a concatenated $c(n) value. It does not execute non-printing control characters. This is shown in the following example:

  SET charstr=$CHAR(65,7,66,67,0,68,11,49,50)
  ZWRITE charstr
FeedbackOpens in a new tab