Caché ObjectScript Reference
Contains the ID of the current input/output device.
contains the device ID of the current device to which all input/output operations are directed. (If the input and output devices are different, $IO
contains the ID of the current input device.)
Caché sets the value of $IO
to the principal input/output device at login. $PRINCIPAL
contains the ID of the principal device. You issue a USE
command to change the current device. Only the USE
commands, a BREAK
command, or a return to the programmer prompt can change this value.
On UNIX® and OpenVMS systems, $IO
contains the actual device name.
On Windows systems, $IO
contains a Caché-generated unique identifier for the principal device. For terminal devices (TRM or TNT), this consists of a pseudo-device name enclosed in vertical bars, a colon and another vertical bar, followed by the device’s process ID (pid) number. For non-terminal devices, the pseudo-device name is enclosed in vertical bars and followed by a unique numeric identifier.
For a Caché terminal: |TRM|:|pid
(File descriptors are used with CALLIN/CALLOUT remote access.)
For the default printer: |PRN|
If the principal device is a null device (which is the default for a background process), $IO
contains the null device name with ":pid" appended, thus allowing you to use $IO
for a unique subscript. The null device name contained in $IO
depends on the operating system.
For Windows systems, $IO
For UNIX® systems, $IO
For OpenVMS systems, $IO
If the input device is redirected via a pipe or file, $IO
You can test the value of $IO
, as in the following OpenVMS example:
WRITE !,"Old device: ",old,!,"Current device: ",$IO
The default device number for a device is configurable. Go to the Management Portal
, select [Home] > [Configuration] > [Device Settings] > [Devices]
. For the desired device, click Edit
to display and modify its Physical Device Name:
option. If you do this, $IO
will contain the assigned device number, rather than the actual operating system device name.
This special variable cannot be modified using the SET
command. Attempting to do so results in a <SYNTAX> error.