User`s guide
4-153
Printer, Plotter, and Spooler Subsystem Programming
41.%* – Pops the top two values (a10 and a 12) off the stack, multiplies them together, and
pushes the resultant 120 onto the stack.
42.%* – Pops the top two values (a 120 and a 3200) off the stack, multiplies them together,
and pushes the resultant 384000 onto the stack.
43.%G_w – Pushes a 0 onto the stack.
44.%t – Pops the 0 off the stack and, since it is a FALSE (zero) value, calls for the
evaluation of %{3000}.
45.%{3000} – Pushes a 3000 onto the stack.
46.%/ – Pops the top two values (a 3000 and a 384000) off the stack, divides the second
value popped by the first value popped, and pushes the resultant 128 onto the stack.
47.%d – Pops the 128 off the stack and returns it, in ASCII format, to the in–progress
calculation of ia, the input data stream pipeline for ASCII jobs.
Why the Stack Language Describing Page Width Works
Going beyond the mechanical description of what happens when piobe resolves the
reference to %wW, here is a description of why the printer colon file escape sequence logic
described above works.
The IBM LaserPrinter 4029 Series technical reference contains a figure and a table that
together describe the printable and unprintable areas on a page, and the paper and
envelope dimensions, in pels, for standard paper and envelope sizes. For instance, the
printable area on an 8.5 x 11 (width by length) inch page is 2400 x 3200 pels (width by
length). Note that if the page is rotated either 90 or 270 degrees for landscape printing, the
dimensions are swapped and become 3200 x 2400 pels (width by length).
The evaluation of %IwW begins by checking to see if the w flag was used on the command
line; if it was, then there are no calculations to perform. The requested value will be used.
(That is not a promise that it will work, just that it will be used.) If the w flag was not used on
the command line, then piobe has to figure out how wide the page is under the current job
environment, as determined by other command line flags and by colon file defaults.
The first item checked in the evaluation of _w (page width) is page orientation (_z). As
noted above, rotating the page by odd multiples of 90 degrees flips the page dimensions.
Looking at the if–then–else statement that is the beginning of the definition of wK, it can be
seen that the value of _z is a switch that controls which of wJ and wK will be used for page
width. If the page has a portrait orientation, then wJ is width. If the page has a landscape
orientation, then wK is width. After the page width in pels is resolved, the remainder of the
escape sequences in the definition of wK just take pitch and character–width (double wide
or not) into account while converting the number of pels to the number of characters.
wK is selected because the page orientation is landscape. Thus far all that is known is that
the dimensions have been flipped; what the dimensions actually are is still unknown. The
evaluation of wK begins by fetching the value (if any) of a command line usage of the Q
flag, which is a printer–dependent value requesting a specific paper size. If the Q flag was
used on the command line, then that value will be used to select the paper width in pels,
otherwise a value for Q will be determined by evaluating Wu, which is a value for the paper
source based on the attributes _O (type of input paper handling) and _u (input paper
source). Note that _Q is defined as %IwQ, whose definition begins with %IWu.
Since Q was not used on the command line, the evaluation of Wu determines that the O flag
wasn’t used either, and so executes the else clause in the outer if–then–else statement in
the definition of Wu, returning the default colon file value of _u, 1, to the evaluation of wQ.
Since this is as deep as the nesting of escape sequences goes for the evaluation of _w, it is
worth taking a closer look at the logic defining Wu. Keep in mind the definitions and legal
values for O, u, and Q, which are:
• O – type of input paper handling – 1 (manual), 2 (continuous forms), 3 (sheet feed) –
default is sheet feed.