ON PAGE example
This example uses EJECT PAGE in conjunction with ON PAGE to print a footer on each page. In this example, a page length of 5 is set up (lines 0 through 4). Text is printed on four lines: 0,1,2,3, and the footer prints on line 4. Eight lines of text are printed on two pages:
set talk off
clear
set printer on
_padvance="LINEFEEDS"
_plength=5
_pageno=1
eject
on page at line 3 do Page_Brk
printjob
for i = 1 to 8
??
"Line of text ",_pageno,_plineno,i
?
endfor
on page // turn off on page
endprintjob
close printer
procedure Page_Brk
??
" Page Footer",_pageno,_plineno
eject
page
return
//// Page Line i
// This prints out as:
//
// Line of text 1 0 1
// Line of text 1 1 2
// Line of text 1 2 3
// Line of text 1 3 4
// Page Footing 1 4
// Line of text 2 0 5
// Line of text 2 1 6
// Line of text 2 2 7
// Line of text 2 3 8
// Page Footer 2 4