User Defined Macros


 

User defined MACRO commands are available as follows:

:n {string}

Define user command 'n', where 'n' is from 0 through 9 and 99.

:n>

Move user defined command 'n' (0 through 9 and 99) from the macro work area into the data file. This allows editing of the user defined command.

:n<

Move user defined command 'n' (0 through 9 and 99) from the data file into the macro work area. This saves a modified user defined command for usage within this edit program.

:0L"{FILESPEC}"

Load the user defined commands from the specified file into the macro work area.

:0S"{FILESPEC}"

Store the user defined commands from the macro work area into the specified file. If the file already exists, the data present is overwritten.

 

A special user defined macro ':99', if present in an edit definition file, is executed upon loading of SUNEDIT. For example:

:99 :t 10,25,45|:ga23

 

This sets the tabs to 10, 25 and 45 and the screen positioned to line 23.

 

An example of the user defined macros :0 through :9 would be as follows:

:0 :FA LABEL|:M2 \|:0

 

This command sets up the first user defined macro (:0) to perform two operations. The first operation performs a FIND ABSOLUTE on the string 'LABEL'. After finding this string, the next command is to MODIFY field 2 as specified (this results in no data being found in field 2). Next, the :0 command is repeated by specifying ':0' as the last command in the string.

 

The vertical bar separates the commands in the user defined macros. Commands are taken from the user defined macros exactly as if they had been entered at the keyboard. The first operation must be completed successfully before the next is considered. If an operation within the command string cannot be completed, the string is then terminated.

 

User defined macros may be saved and made available for usage by creating the definition file 'EDIT.DEF' (or any other file name chosen by the operator and specified on the command line - see the section on Execution) and entering these commands into this file. Upon execution of SUNEDIT, this file is loaded (if present) and any commands defined are set up. When setting up these commands in EDIT.DEF, it is necessary to start the lines with two colons.

 

To display the current list of user defined macros enter the command :00. This displays all 10 macros as currently defined.

 

The ESCAPE sequence terminates the execution of the user defined macro list.

 

 

See Also: SUNEDIT Commands, Line Edit Mode, SUNEDIT

 



System Utilities Tab Commands Editor Execution