PS TEXT FORMAT Reference Manual

Introduction to TFORM
11387 Tandem Computers Incorporated 3–45
Tips
You neither abbreviate FUNCTION, RETURN, or ENDFUNCTION
commands nor combine them with other commands; each must be on a
line of its own.
Unlike macros, functions cannot create text lines and cannot produce
side effects such as turning the JOIN command ON or OFF.
You can put FUNCTION constructs anywhere you want in your
document, but you should group them together in one place. If you put
them in a separate file and read them in, several different documents
can share them.
You can abbreviate
function-names
, just as you abbreviate TFORM-
supplied function, macro, and command names. For this reason, any
name you use must be unique within its first three characters. You can
use 1- and 2-letter names if you wish, but they can’t be abbreviated.
All the commands that make up a FUNCTION construct must be in a
single input file. You should, therefore, check that any FUNCTION
construct contained in a sourced-in file is both begun and ended in
that file.
For every FUNCTION BEGIN or FUNCTION APPEND command, you
must have a corresponding ENDFUNCTION command. If you put a
function-name
in an ENDFUNCTION command, it must agree with
the name in the most recent FUNCTION BEGIN or FUNCTION
APPEND command.
In general, you should declare as LOCAL all variables that are relevant
only within the function.
See Appendix G for an example of a FUNCTION construct.