System Debug Reference Manual (32650-90888)

Chapter 6 207
System Debug Command Specifications M-X
MAC[RO]
declarations that precede the macro body. Any number of these options can
be specified in any order. Each option is specified as a keyword, followed by
a (case sensitive) string value:
MACVER =
version_string
MACKEY =
keyword_string
MACHELP =
help_string
The following are typical valid declarations for macro options:
MACVER = 'A.00.01'
MACKEY = "PROCESS PIN PARENT"
MACHELP = "Returns the pin number of the parent process"
By default, the null string (' ') is assigned for unspecified options.
Examples
$nmdat > macro showtime {wl 'The current time is: ' time}
$nmdat > showtime
The current time is: 2:14 PM
This example demonstrates a simple macro that executes a single command. The new
macro, named showtime, is defined and then executed as if it were a command. The macro
body, in this case a simple write command, is executed, and the current time is displayed.
This macro has no parameters.
$nmdat > macro starline (num:u16=#20) {
{$1} multi > while num > 0 do {
{$2} multi > w '*';
{$2} multi > loc num num -1 };
{$1} multi > wl }
$nmdat > starline (5)
*****
$nmdat > starline (#60)|
************************************************************
$nmdat > starline
********************
$nmdat > starline (-3)
Parameter type incompatibility. (error #4235)
expected the parameter "num:U16" for "starline"
starline (-3)
^
Error during macro evaluation. (error #2115)
This example defines a macro named starline that prints a line of stars. The number of
stars is based on the macro parameter num that is typed (unsigned 16-bit), and has a
default value of decimal twenty.