PS TEXT FORMAT Reference Manual

Introduction to TFORM
11387 Tandem Computers Incorporated 3–41
FUNCTION TFORM supplies users with a set of functions for evaluating expressions.
However, if you want to create your own function, you can use the set of
commands in the FUNCTION construct. As with a TFORM-supplied
function, you can use your function as part of an expression. When you call
the function in your text, it evaluates the expression, which returns a value,
which in turn is inserted into your text at that point.
A function is a group of commands that you define as a unit. You can refer
to it repeatedly within the main body of your document, and you can pass
up to 10 arguments to it so that its action can be dynamically altered.
You can change the structure of a function within your document by
appending lines to it. You can also delete the function during document
processing.
What to Enter
\FUNCTION
function-name
BEGIN [LOCAL
var
[‚
var
]... ]
APPEND
DELETE
. . .
commands
. . .
\RETURN
expression
. . .
commands
. . .
\ENDFUNCTION [
function-name
]
function-name
is a name that represents a FUNCTION construct. A
function-name
can be no longer than 32 characters; it must begin with a letter; and the
remaining characters may be letters, numbers, and/or underscore (_)
characters. The name must be unique from all other function names.