How ^%IS Works
Device Prompt
When you call the ^%IS utility, InterSystems IRIS prompts for a device name. You respond in one of the following ways:
-
Enter the desired device name or ID number.
-
Enter a mnemonic for the device.
-
Press Enter to select the current device.
^%IS responds as follows:
-
If you enter a device mnemonic, ^%IS finds the corresponding device in the ^%IS global and opens it.
-
If you enter a device name, ^%IS issues an OPEN command to that device.
-
If the device is an InterSystems IRIS device ID, ^%IS checks the device table to see if that number is remapped to another actual device number. ^%IS then issues an OPEN for the device.
See the discussion “Alternate Devices” that is part of ^%IS Mnemonics section below for information about using alternate devices.
Additional Questions
If the device you specify is a terminal, the utility prompts you with a default right margin. Press Enter to select that margin or type a different value. If a program later attempts to write past the specified right margin, the operating system inserts a “CR LF” (carriage return and line feed) when the margin is reached. If you select a device other than a terminal, the utility asks other types of secondary questions.
Examples
In the following example, the user presses Enter to specify the terminal. The utility prompts for a right margin, suggesting a default value of 80. At the => prompt the user enters 132 as the new margin setting.
%SYS>DO ^%IS
Device: <RETURN>
Right margin: 80 => 132
%SYS>
^%IS Sets the Variable IO and Returns Values of Other Variables
When you select a device, ^%IS sets the variable IO to the device name or number used in the OPEN command. ^%IS also returns the values of the variables listed in the following table:
^%IS Device Variable Values
Variable |
Example |
Description |
%ANS |
Yes |
Generic dialog answer. |
IO |
64 |
Device number or device mnemonic of selected device. |
IOF |
# |
Form feed. WRITE # issues a form feed and changes $Y. WRITE @IOF should be used to form feed. |
IOBS |
*8 |
Backspace. WRITE $CHAR(8) issues a backspace and changes $X. WRITE *8 issues a backspace but does not change $X. WRITE @IOBS should be used to backspace. |
IOM |
80 |
Right margin. |
IOSL |
66 |
Screen/page length. |
IOT |
TRM |
Device type. |
IOST |
C-VT220 |
Device subtype (VT220 in this example). |
IOPAR |
("auv":0:2048) |
Any other OPEN parameters. |
MSYS |
M/WNT |
Type of system (such as UNIX®, Windows). |
POP |
0 |
If not zero, specifies that no device was selected. That is, the user entered STOP in response to Device: prompt. |
RMSDF |
RW |
Read/Write permissions. |
OPEN Parameters
By default, the OPEN command uses the specifications for the device defined in the ^%IS global. You can override these settings by specifying other settings when you use ^%IS.
Issue a USE Command
After running ^%IS, the application must issue a USE command to the device opened by ^%IS. You can use the variable IO, as long as you understand that its value changes every time you call ^%IS. Then, subsequent InterSystems IRIS I/O commands, such as READ and WRITE, refer to that device.
Issue a CLOSE Command
The user or application developer must close devices opened with the ^%IS utility.