PS TEXT FORMAT Reference Manual
Introduction to TFORM
11387 Tandem Computers Incorporated 3–99
How to Use the MACRO Construct
You call a macro by using the name in a macro invocation command
(described elsewhere in this section).
You can also change the structure of a macro within your document by
appending lines to it, and you can delete the macro (usually to make way
for another macro with the same name) during document processing.
The different commands of the MACRO construct are described in the
following paragraphs.
MACRO
macro-name
BEGIN
This command defines a macro with that given name. The text and
commands that follow, up to and including the associated
ENDMACRO command, constitute the body of the macro. You must
enter the MACRO BEGIN command by itself on an input line.
The
macro-name
must be different from other names of TFORM-
supplied macros, macros you define, and all command names. You can
abbreviate a
macro-name
, but this name must remain unique within
its first three characters. If the
macro-name
is not unique, TFORM
issues an error message and ignores the macro.
MACRO
macro-name
BEGIN LOCAL
The keyword LOCAL in a MACRO BEGIN command specifies that all
of the variable names following it on a command line represent entities
that are local to the scope of the macro. The scope of a macro begins
with the MACRO BEGIN command and ends with the ENDMACRO
command, and it includes the scopes of any other macros that the
current macro might invoke. In other words, the macro (and any macro
it invokes) has access to local copies of the specified variables, and it
can alter their values without affecting any variables that might have
the same names elsewhere in the document. Variables not modified
with the keyword LOCAL have a global scope, and if the macro
changes them, they are changed wherever they appear.