DECDMAC—Define Macro

This device control string lets you define a macro consisting of a string of ANSI text and control functions. After you define the macro, you can execute it by using the invoke macro control function (DECINVM). The terminal processes the macro as normal input.

Available in: VT Level 4 mode only.

Programming Tip
You can find how much memory space you have available for macros by using a device status report sequence.

Format

DCS
9/0
Pid
3/?
;
3/11
Pdt
3/?
;
3/11
Pen
3/?
!
2/1
z
7/10
D . . . D
...
ST
9/12

Parameters

Pid
is the macro ID number. Pid can be any number between 0 and 63, otherwise the terminal ignores the command. If you give a macro an ID that already exists, then DECDMAC deletes the old macro definition before using the new one.

Pdt
defines how the terminal treats new macro definitions.

Pdt Meaning
0 or omitted DECDMAC deletes the old macro with the same ID number before defining this new macro.
1 DECDMAC deletes all current macro definitions before defining this macro.
Other The terminal ignores the macro.

Pen
selects the encoding format for the text of the macro definition.

Pen Meaning
0 or omitted Uses standard ASCII characters in the macro.
1 Uses hex pairs in the macro. Each pair of characters in the macro is the hex value for a single ASCII character.
Other The terminal ignores the macro.

D...D
is the data of the control string. This data is the string of text and control functions performed when an application invokes the macro. The data can consist of ASCII text or hex pairs.

When you use ASCII text (Pen = 0 or omitted), the macro consists of the graphic characters that appear in the device control string. Only characters from positions 2/0 through 7/14 and 10/00 through 15/15 in the code table are valid.

When you use hex pairs (Pen = 1), the macro consists of pairs of hex numbers, each of which represents an ASCII character. When using hex pairs, you can also use a repeat introducer in the data string. The repeat introducer is the ! (2/1) character. The repeat introducer lets you repeat any hex pair within the definition string any number of times. You embed repeat sequences within the data string of the macro definition.

Note

If ASCII text is specified as the encoding format, then you cannot use the repeat sequence.

Notes on DECDMAC