PS TEXT FORMAT Reference Manual

Introduction to TFORM
11387 Tandem Computers Incorporated 3–43
FUNCTION
function-name
BEGIN LOCAL
The keyword LOCAL in a FUNCTION BEGIN command specifies that
all of the variable names following it on a command line represent
entities that are used only within the range of the function. The range
of a function begins with the FUNCTION BEGIN command and ends
with the ENDFUNCTION command, and it includes the ranges of any
other functions that the current function might invoke. In other words,
the function and any function it invokes have access to local copies of
the specified variables and 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 range,
and if the function changes them, they are changed wherever they
appear.
FUNCTION
function-name
APPEND
This command defines the beginning of a group of lines, up to the
corresponding ENDFUNCTION command, that are to be added to an
existing function with the specified name. If no such function exists,
APPEND has the same effect as BEGIN.
RETURN
expression
The RETURN command serves two purposes (1) it immediately
terminates the execution of the function; and (2) it sets the value of the
function to the value of the expression in the RETURN command.
When the function has been executed, the value of the function replaces
the function reference at that point in the text (as with TFORM-supplied
functions). The RETURN command must be on a line of its own.