Controlling Devices with Mnemonic Spaces
A mnemonic space is an InterSystems IRIS routine that performs device control actions, such as cursor movement and device attributes. Each action is associated with a label. These labels are the mnemonics used in the WRITE /mnemonic command. For more information on the WRITE /mnemonic syntax, see the WRITE command description for each device type in the other pages in this document.
Predefined Mnemonic Spaces
InterSystems IRIS provides predefined mnemonic spaces described in the table below.
Routine Name | Device Type Default | Description |
---|---|---|
^%X364 | Terminals, Sequential files, Other devices | Mnemonic space for X3.64 (ANSI) terminals. For information, see Mnemonic Space for X3.64. |
^%XDTM | DTM PC Console | Mnemonic space for DTM PC Console. For information, see Mnemonic Space for DTM PC Console. |
Setting Up Default Mnemonic Spaces
You can change the mnemonic space that is a default for the following device types in the Management Portal. Select System Administration, Configuration, Device Settings, IO Settings. This displays the mnemonics for the following:
-
Terminals
-
Sequential files
-
Other
After a default mnemonic space is defined, the control mnemonics in the default mnemonic space for the current device are used if a WRITE /mnemonic command is issued, unless the default mnemonic space is overridden by a mnespace argument to the OPEN or USE command for the current device.
Creating a Mnemonic Space
You can create your own mnemonic space routines. For example, you might want to create your own for terminal I/O.
-
Create an InterSystems IRIS routine containing the control mnemonics you want. Keep in mind the following points about your routine:
-
The entry points in this routine must be uppercase. These entry points are the mnemonics you reference in WRITE /mnemonic commands.
-
Some entry points may require arguments. The code in the mnemonic space at an entry point performs an action on the current device.
-
Cursor movement routines do not move the cursor past the edge of the screen in any direction, nor do they wrap the cursor.
-
-
To make this mnemonic space available to all users, give the InterSystems IRIS routine a name that begins with % and put it in the %SYS namespace.
Select a Mnemonic Space
Before you issue WRITE /mnemonic commands to a device, you decide whether you want to use the default mnemonic space for the device type as specified in the Management Portal configuration setting.
-
When using the default mnemonic space, do not include a mnespace parameter when you issue OPEN or USE commands for the device.
-
To use another mnemonic space, specify its name in the mnespace parameter of the OPEN or USE command you issue for the device.
USE "device"::"^%X364"
For information on using the mnespace parameter, see the OPEN command and the USE command, as well as the pages on individual device types.