PS TEXT FORMAT Reference Manual

Escape Sequences
4-12 11387 Tandem Computers Incorporated
TFORM does the pre-execution scan only once and stores the resulting
command image for future use. That's why, in the following example, you
don't have to issue a FOOTER command at the end of each page; TFORM
just keeps executing the saved one until you issue a new one:
\PAGE 1
\FOOTER "\\(sys_pagenumber\\)|\(sys_pagenumber\)|sys_pagenumber"
TFORM evaluates the FOOTER command to
\FOOTER "\(sys_pagenumber\)|1|sys_pagenumber"
when it first encounters it. Since TFORM does not scan it again, the title
remains like this when TFORM stores it. At the bottom of each page,
TFORM therefore prints
n
1 sys_pagenumber
where n represents the changing value of SYS_PAGENUMBER and prints
as the then-current page number for each page. The center portion is fixed
to the value of SYS_PAGENUMBER at pre-execution scan (here, the value
is page 1), and remains that way; the right-justified portion is, of course,
simply a string and is not evaluated.
You can use double indirection to insert section titles in headers, too, or in
other instances where you want the capability for constant updating.
When using indirection and double indirection, remember:
For a “one-shot” command that uses strings (such as TITLE), where
you want a value that is current both at the time of pre-execution scan
and at execution, use the indirection escape sequence without double
indirection: \( exp \).
For a command that uses strings and that TFORM executes repeatedly
(such as HEADER or FOOTER) in which you want a value that is
current at the time of each execution, use double indirection:
\( exp \\).