Skip to main content

^%IS Mnemonics

^%IS Mnemonics

^%IS has several features to simplify its use. For example, if you want to send I/O to your own terminal, simply press Enter at the “Device” prompt. You can also use built-in default mnemonics or new mnemonics you define yourself.

Device Mnemonics

It is useful to have mnemonics for the various devices and, in some cases, to have more than one mnemonic for a single device. Multiple mnemonics allow you to specify different device characteristics for the device and vary characteristics according to the manner in which the device is used. For example, a terminal that is normally used for data entry, and thus has the characteristics of a terminal, may have an auxiliary printer attached. By assigning a different mnemonic that opens the same device with different characteristics, you can treat the terminal/printer combination as a printer when you want hard copy.

You can configure device mnemonics and characteristics using the Management Portal. To learn how to define and activate mnemonic spaces, see the section Defining Default Mnemonic Spaces.

Default Mnemonics

The ^%IS global is initialized at installation with several default mnemonics. For instance, there are two default mnemonics, SPOOL and 2, for the InterSystems IRIS spooler. Simply type “2” or “SPOOL” to send output to the InterSystems IRIS spooler.

If you are logged in on an RT:, LT:, or VT: type device, and your terminal is the current device, ^%IS will accept 0, “”, or the value of IO in response to the “Device” prompt. It will use the appropriate template (RT0:, LT0: or VT0:) for your terminal type to generate the information for your terminal.

Alternate Devices

If users enter an “A” at the Device prompt, output goes to the alternate device defined for the current device. Usually, users expect the alternate device to be a printer. Instead of defining a separate alternate device for each device in the system, you can create a device, pointing to a printer, with the mnemonic “A”. Then, when users enter “A” at the ^%IS “Device” prompt, output goes to that device.

CURRENT^%IS Entry Point

CURRENT is an internal entry point within the ^%IS utility that you can use to obtain the device parameters of the current device. This call to ^%IS returns the values of different variables, so you can keep one set of parameters for your principal device and a different set for a device with different characteristics. Ordinarily, you make a call to this internal entry point when you log in, to allow the application access to the device characteristics of the principal device. CURRENT^%IS returns the values of the variables listed in the table below:

CURRENT Return Values
Variable Example Description
FF 3 WRITE @FF should be used for form feed on this device
BS *8 WRITE @BS should be used to backspace
RM 80 Right margin
SL 24 Screen/page length
SUB C-VT100 Device subtype
XY (see Example below) Set $X to DX and $Y to DY to perform direct cursor positioning

Example

After calling CURRENT^%IS, set $X and $Y to DX and DY to position the cursor.

  DO CURRENT^%IS
  WRITE *27,*61,*DY+32,*DX+32 
  SET $X=DX,$Y=DY

IN^%IS Entry Point

IN is an internal entry point within ^%IS that can be called by routines that only plan to do input from the device. This entry point can be used to ensure that you do not select an output-only device such as a printer.

%SYS> Do IN^%IS

Device: 3 
Right margin: 132= <RETURN>
[you can't read from this device] 
Device: <RETURN>  
Right margin: 80= <RETURN>
%SYS>

OUT^%IS Entry Point

OUT is an internal entry point within ^%IS that can be called by routines that only plan to do output to the device.

Spooling

InterSystems IRIS spooling is independent of the spooling performed by your operating system. Spooling in InterSystems IRIS is a technique that lets you automatically save the output of a program in a global instead of printing it immediately. You can print the output later by sending the contents of the global to the printer.

The mnemonic SPOOL is a default mnemonic. To specify spooling, enter “SPOOL” in response to the Device prompt. The system then asks for a spool file name and description. This is a named used in the ^SPOOL global—not a separate file name at the operating system level.

If any existing file names start with or match the name you specify, they are displayed, and you are asked to choose one. If you select none of the existing files, the system allows you to create a new file with the specified name and description as shown in the following example:

Device: SPOOL
Name:TEST
1. 1 TEST 02 Nov 1999 10:17 am First test 
2. 2 TEST 02 Nov 1999 10:18 am Second Test 
Select one: <Return> not found
Create new document 'TEST'? Yes => yes
Description: Third Test

If you reselect an existing document because you would like to continue adding to an existing file, the system gives you the following options:

  1. Add to the very end of the file;

  2. Restart at the top of the last page, in which case the lines that will be deleted are displayed on the screen;

  3. Restart at page 1 (the beginning).

You can pass the variables listed in the table below to ^%IS when you call it for spooling.

Spool Variables You Can Pass to ^%IS
Variable Function
IODOC Document name (when this variable exists and is not a null string all questions are suppressed, and a new document with this name is automatically created).
IODES Free text description.
IOPGM Name of a routine that should be called at print time to allow the user to set up printer for the proper forms alignment.

Further Features of ^%IS

^%IS can also be used to perform the following tasks:

  • Right margin suppressing—It is possible to set up a terminal line so that whenever that device is selected, the Right margin question is suppressed; the default value is automatically assumed.

  • Automatic device selection—If the variable IOP exists when the ^%IS utility is called, the utility automatically tries to open that device rather than ask for a device. If ^%IS is unsuccessful, it sets the variable POP to 1.

  • Preconfigured terminals—Using the Management Portal, you can configure a device that does not request any device information from the user.

FeedbackOpens in a new tab