Macro item

The master dictionary can include items called macros.

A macro can contain:

  • One or more TCL statements

  • Input required by the statements

It is invoked by entering its name (item-ID) at the TCL prompt. In addition, any text that is typed following the macro item-ID is appended to the first TCL statement in the macro line. This allows for the creation of a general macro and for assigning specific criteria in the TCL statement.

To execute the macro, type the macro name (item-ID) at the TCL prompt and press ENTER. After the TCL instructions are executed the system returns to the TCL prompt. Macros are created directly in the master dictionary using Update Processor or by invoking the create-macro command, which creates a macro from the last TCL sentence executed.

Master Dictionary
# Attribute Description
0 item-ID Name of the macro.
1 dictionary-code

For a macro item, this must be either an m or n. Comments may follow after the dictionary-code to document the macro. These comments also may be displayed as a help message if this menu is invoked by another menu and you type ? and press ENTER. At least one space must separate the dictionary-code from the comments.

m The macro is to display each statement first and await editing and a carriage return before executing.

n The nonstop macro executes all statements immediately after pressing ENTER.

2 - n statement-1 {<vm> input-1}

to

statement-n {<vm> input-n}

The next TCL statement to be executed is optionally followed by a value mark and any input needed for the statement. As many input entries as required may be entered, separated with value marks.

The macro can contain as many statement or input attributes as desired. If the macro contains more than one TCL statement, it is recommended that the macro not include procs or other macros as part of the TCL sentence, since control is not returned to the current macro.