Specifications
A-9Calculating Page Lenght Using Printer Colon File Escape Sequence
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
• s1 – paper size for tray 1 (upper)
• s2 – paper size for tray 2 (lower)
• s3 – envelope size for envelope feeder
• s4 – envelope size for manual envelope size
In the virtual printer definition for an ASCII queue on a 4029 LaserPrinter, there are only two
unique values for these five attributes: s0, s1, and s2 are all 1, while s3 and s4 are both 3.
Looking back up the nested escape sequences, you can see that the definition of wJ is
composed of an outer if–then–else statement. Both the if and the else pieces of this
statement contain a chain of if–then–else–then–else... statements. The value of Wu (which
is a value for paper source, based on O and u) determines whether the if or the else piece
of the outer statment executes; if Wu is 1 or 2 (less than 3), then the if piece executes;
otherwise the else piece executes. It is in the final determination of wJ that the page length,
in pels, is fixed.
The if piece of the outer if–then–else statement defining wJ selects a pel value from a range
of non–envelope paper sizes; the else piece of the outer if–then–else statement selects a
pel value from a range of envelope paper sizes. Wu controls which piece of the if–then–else
statement executes but, after either the if or else piece has been chosen, it is the value of Q
that causes a pel value to be selected. The five cases listed above work like this:
Case 1: Either the command line value of u or the default from the colon file (1, primary
paper tray) is returned to the evaluation of wQ. The remaining escape sequences in the
definiton of wQ test the value of Wu and select the value of one of s0, s1, s2, s3, or s4.
That value is in turn returned to the evaluation of wJ. If u is 1 or 2, then Q will be 1
(non–envelope paper size). If u is 3, then Q will be 3 (envelope paper size). When the
evaluation of wJ is resumed, a u value of 1 or 2 will direct the process into the if piece of the
outer if–then–else statement, and the Q value of 1 will select a page length of 2400 pels. A