User`s guide
4-145
Printer, Plotter, and Spooler Subsystem Programming
The first item checked in the evaluation of _l (page length) 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 wY, it can be seen that
the value of _z is a switch that controls which of wJ and wK will be used for page length. If
the page has a portrait orientation, then wK is length. If the page has a landscape
orientation, then wJ is length. After the page length in pels is resolved, the remainder of the
escape sequences in the definition of wY just take vertical line denisty into account while
converting the number of pels to the number of lines.
wJ 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 wJ 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 length 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 _l, 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.
• u – input paper source – 1 (primary), 2 (alternate), 3 (envelope) – default is primary.
• Q – paper size for input paper source – values are printer–dependent – defined by
combination of O and u.
The escape sequences defining Wu say this:
• Case 1: If the O flag was not used on the command line, then return the colon file default
value for _u. For example, if the user did not specify a type of input paper handling, then
return the input paper source (either from the command line or the default from the colon
file) to the evaluation of %IwQ.
• Case 2: If the O flag was used on the command line but its value was not 1, then return
the colon file’s default value for _u. For example, if the user specified a type of input
paper handling other than manual, then return the input paper source (either from the
command line or the default from the colon file) to the evaluation of %IwQ.
• Case 3: If the O flag was used on the command line and its value was 1, and the u flag
was not used on the command line, then return a 0. For example, if the user–specified
manual paper handling but did not specify an input paper source, then return a 0 to the
evaluation of %IwQ.
• Case 4: If the O flag was used on the command line and its value was 1, and the u flag
was used on the command line and its value was not greater than 2, then return a 0. For
example, if the user specified manual paper handling and also specified either the
primary or alternate input paper source, then return a 0 to the evaluation of %IwQ.
• Case 5: If the O flag was used on the command line and its value was 1, and the u flag
was used on the command line and its value was greater than 2, then return a 4, For
example, if the user specified manual paper handling and also specified an input paper
source of envelope, then return a 4 to the evaluation of %IwQ.
The definition of wQ is an if–then–else–then–else–then–else–then–else statement that
repeatedly compares the value of Wu to the integers 0, 1, 2, and 3, looking for a match. The
match selects the value of one of the attriubes s0, s1, s2, s3, or s4, respectively (s4 is
selected when there is no other match). The items these attributes define are as follows:
• s0 – paper size for manual paper feed