DEC Editor Macros PDF Print E-mail

For massive repetitive edit tasks unsuitable for the *subs command mentioned above, you can use a DEC Editor Macro. Macros are simply a string of commands put together in sequence. Macros are not saved once you leave the edit session, but you can store them by copying them to the windows clipboard just after entering them, then pasting to a text file. You can edit the text file and paste the macro string of text instead of keying it.


Before you attempt a macro, practice the series of keystrokes needed in order to verify them and memorize them. Then perform these steps:

1) Enter full screen mode (enter c and the *, which means change to screen mode)
2) Will your macro involve a search? If so, set it up now with PF1-PF3 followed by the string and PF4
3) Position the cursor where want the macro to begin
4) Use CTRL-K ‘key’ to define the define the ‘key’ used to invoke macro (F11 always seems to be available)
5) Start with a left parenthesis; type the keystrokes you want in the macro, e.g. arrow right, word right, PF3 to find the next occurrence of the text string, backspace, down arrow, etc. If you want to insert text, type an I followed by the characters you want. When input is done type ^z (shift-6 followed by the letter z).
6) When done, close with a right parenthesis and a period(.), then hit the keypad enter key (not the regular keyboard enter key) to close the macro.
7) To invoke the macro, position the cursor where you want to start, then hit ‘key’ (the key you defined in 3 above)
8) To invoke the macro x times, hit PF1 x ‘key’ . This allows you to perform the instruction thousands of times.

By default, your macro will be lost when you end the edit session. If you have E-Term-32 or EM320W or EM340W, it is possible to save, edit and reuse macros. First set up one of your mouse buttons to select text (in E-Term, setup/ mouse/ then set Control-left button to use mark (column mode). After you type the macro keystrokes, just before you hit enter, you can select the macro text, then hit E-Term’s edit/copy command, and paste the text into a text file. If you want to reuse it later, just get ready to enter your macro keystrokes, open the text file containing the macro, copy it to the clipboard, then use the E-Term edit/paste to paste the macro in.


No keypad because you’re using a notebook PC?

If you are using E-Term32, EM320W or EM340W, you can also use the toolbar for the DEC Editor. Drag if from the emulator frame so that it floats free, then resize it so it looks like a keypad instead of a ribbon.