PS TEXT FORMAT Reference Manual
Examples of Function and Macro Constructs
G-4 11387 Tandem Computers Incorporated
The following application of span shows how you can use digits to
represent two specified days (the month and day for each) and then call
span to evaluate those digits to produce a result.
When your file is run, span is enclosed in an indirection escape sequence;
this tells TFORM to evaluate the expression (arguments 1, 2, 3, and 4) and
put the resulting value in the text in place of the expression. If it weren’t
enclosed in an indirection escape sequence, the expression would be
treated as normal text and printed literally. Here is an application that uses
the user function span and your input:
Dear Diary,
February 1, 1986:
I start my diary. I want to tell you all about
Steve.
February 25:
\(span(2,1,2,25)\) days have gone by, and he
still hasn't noticed me.
April 3:
It has been \(span (2,25,4,3)\) days since I
wrote, but today's the day he finally said "Hi!"
to me.
May 7 Since he first talked to me, it took
\(span(4,3,5,7)\) days for me to ask him to go
out, but I asked him! Now what?
The digits that you use in the above application correspond to the
following variables:
month_from
day_from
month_to
day_to
\(span(2, 1, 2, 25)\)