IBM AS/400 Frozen Dessert Maker User Manual


 
Accessing Printer Devices
*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... *
OFilename++DF..N01N02N03Excnam++++B++A++Sb+Sa+.............................
OPRINT D OANL2 3 6
O OR L2
O..............N01N02N03Field+++++++++YB.End++PConstant/editword/DTformat++
O ACCT 8
O*
Figure 158. Printing a Field on Every Page
Using the Fetch-Overflow Routine in Program-Described Files
When there is not enough space left on a page to print the remaining detail, total,
exception, and heading lines conditioned by the overflow indicator, the fetch over-
flow routine can be called. This routine causes an overflow. To determine when to
fetch the overflow routine, study all possible overflow situations. By counting lines
and spaces, you can calculate what happens if overflow occurs on each detail,
total, and exception line.
The fetch-overflow routine allows you to alter the basic ILE RPG overflow logic to
prevent printing over the perforation and to let you use as much of the page as
possible. During the regular program cycle, the compiler checks only once, imme-
diately after total output, to see if the overflow indicator is on. When the fetch over-
flow function is specified, the compiler checks overflow on each line for which fetch
overflow is specified.
Figure 159 on page 321 shows the normal processing of overflow printing when
fetch overflow is set on and when it is set off.
320 ILE RPG for AS/400 Programmer's Guide