B. Terminal Monitor : Terminal Monitor Macros : System Macros
System Macros
The macro processor contains several other macros built into it. In the following descriptions, some of the parameter specifiers are marked with two dollar signs rather than one. This feature is discussed in (see page Parameter Prescan.
{define; $$t; $$r}
Defines a macro as discussed previously. Special processing, which is discussed in a later section, occurs on the template part.
{rawdefine; $$t; $$r}
Specifies another form of {define}, where the special processing does not take place. This is rarely used but is seen when listing macros with the \l command, because the DBMS Server converts all {define} statements into their corresponding {rawdefine} form.
{remove; $$n}
Removes all macros beginning with name $n. For example, typing:
{define; get part $n; . . . }
{define; get emp $x; . . . }
defines two macros that start with "get."
{remove; get}
removes both of the get macros. Typing {remove; get part} removes only the first macro.
{type $$s}
Types $s onto the terminal
{read $$s}
Types $s and reads a line from the terminal. The typed line acts as the replacement text for the macro.
Contains the number of characters read in the most recent {read} or {readdefine}.
A Ctrl-Z (VMS) or Ctrl-D (UNIX) (end of file) becomes -1, a single newline becomes zero, and so forth, so that the number accurately reflects printing characters.
{readdefine; $$n; $$s}
Also types $s and reads a line, but it further creates a macro called $n, which is set to the line entered at the terminal. This lets you set aside a line for further processing. The replacement text for {readdefine} is the count of the number of characters in the line. {readcount} is also defined with this number.
{ifsame; $$a; $$b; $t; $f}
Compares the strings $a and $b. If they match precisely, the replacement text becomes $t; otherwise it becomes $f.
{ifeq; $$a; $$b; $t; $f}
Similar to {ifsame}, but the comparison is numeric
{ifgt; $$a; $$b; $t; $f}
Like {ifeq}, but the test is for $a strictly greater than $b
{substr; $$b; $$e; $$s}
Returns the part of string $s between character positions $b and $e, numbered from one. If $b or $e is out of range, it is moved in range as much as possible.
{dump; $$n}
Returns the value of the macro (or macros) that match $n, using the same algorithm as remove. The {dump} macro produces a listing of macros in {rawdefine} form.
Dump without arguments dumps all macros. This macro works in conjunction with the \eval statement.