User`s guide

4-141
Printer, Plotter, and Spooler Subsystem Programming
%? <IF>
%CO PUSH: (1 If –O Flag on Command Line; Otherwise 0)
%t <THEN>
%? <IF>
%G_O PUSH: (Type of INPUT PAPER HANDLING (backward
compatibility
purpose only))
%{1} PUSH: (Integer Constant 1)
%= PUSH: (pop2 = pop1 ?)
%t <THEN>
%? <IF>
%Cu PUSH: (1 If –u Flag on Command Line; Otherwise
0)
%t <THEN>
%? <IF>
%G_u PUSH: (Input PAPER SOURCE)
%{2} PUSH: (Integer Constant 2)
%> PUSH: (pop2 > pop1 ?)
%t <THEN>
%{4} PUSH: (Integer Constant 4)
%e <ELSE>
%{0} PUSH: (Integer Constant 0)
%; <END>
%e <ELSE>
%{0} PUSH: (Integer Constant 0)
%; <END>
%e <ELSE>
%G_u PUSH: (Input PAPER SOURCE)
%; <END>
%e <ELSE>
%G_u PUSH: (Input PAPER SOURCE)
%; <END>
%d POP –> ASCII String –> OUTPUT
The calculation for the value of Wu begins by evaluating %CO, which pushes a 1 onto the
stack if the O flag was specified on the command line, else it pushes a 0 onto the stack. The
job submission command being used in this example did not use the O flag, so a 0 is
pushed onto the stack. The next %t, finding a 0 on the stack, skips the next 23 lines of
printer colon file escape sequences and evaluates the %e (else) clause on the fourth line
from the bottom of the formatted form of the Wu attribute. The else clause is %G_u, which
pushes the value of _u, the input paper source, onto the stack. The default value for _u for
this virtual printer is 1, so a 1 is pushed onto the stack. The next %; terminates the original
%?. The only remaining escape sequence, %d, pops the top value (a 1) off the stack and
returns it in ASCII format to the in–progress calculation of wQ.
The 1 returned to the in–progress calculation of wQ is the value of Wu, and is pushed onto
the stack. The next %{0} pushes a 0 onto the stack. %= pops the top two values (a 0 and a
1) off the stack and, checking them for equality, fails; a 0 is pushed onto the stack.
The next %t finds the 0 and so skips the %Gs0 and instead evaluates the %e (else) clause.
Wu (a 1) is again pushed onto the stack. The %{1} pushes another 1 onto the stack. The
%= again pops the top two values ( two 1s) off the stack and, checking them for equality,
succeeds; a 1 is pushed onto the stack.
The next %t finds the 1 and so evaluates the %Gs1. The s1 attribute is a number
representing the paper size for paper tray 1, the upper paper tray, and its default value in
this virtual printer definition is 1. This 1 is pushed onto the stack. All but the very last of the
remaining printer colon escape sequences in the evaluation of wQ are skipped. The %d
pops the top value (a 1) off the stack and returns it in ASCII format to the in–progress
calculation of wJ.
The 1 returned to the in–progress caclulation of wJ is the value of _Q, and is pushed onto
the stack. It is immediately popped back off the stack and stored in the internal variable q.
Wu, already determined to be 1, is again pushed onto the stack. %{3} pushes a 3 onto the
stack, then the %< pops the top two values off the stack and checks to see if the second