Skip to main content

Device Special Variables

Some I/O commands affect the value of certain system variables. This section defines these variables and tells why you might want to use them. These variables are changed only when an I/O command is issued to the current device. These device special variables are summarized in the table below:

Device Special Variables
Variable Purpose
$IO Contains the device ID of the current device, to which all output operations are directed. InterSystems IRIS sets the value of $IO to the principal output device at login, and only the USE and CLOSE commands, a BREAK command, or a return to programmer mode can change this value.
$X Contains a running total of printable characters written since the last carriage return on the current device. This number ranges from 0 to the width of the device.
$Y Contains a running total of line feeds written since the last form feed on the current device. This number ranges from 0 to the length of the device.
$ZA Contains READ status information after a READ command to a terminal device.
$ZB Contains the character sequence or event ended the last READ operation on the current device.
$ZMODE Contains the parameters you used with the OPEN or USE command for the current device.

$X and $Y are useful in formatting printed output. For more information on them, see Terminal I/O.

FeedbackOpens in a new tab