_plineno example
This example prints 32 lines of output on four pages. The page length is set at 10 lines per page, and the report prints the page and line number on each line using _pageno and _plineno:
_pbpage=1 // reset the default pbpage
_pepage=32767 // reset the default pepage
_plength=10 // set the page length to 10 lines
_pageno=1
set printer on
printjob // printjob resets _plineno to 0
for i=1 TO 32
if
_plineno=0 // At first line of page
//?
?
"Top of Page ",_pageno
?
endif
??
"Page",_pageno," Line",_plineno,i
?
// now force a linefeed
endfor
endprintjob
set printer off
close printer
// The first two pages of output appear as follows:
//
// Top of Page 1
// Page 1 Line 2.00 1
// Page 1 Line 3.00 2
// Page 1 Line 4.00 3
// Page 1 Line 5.00 4
// Page 1 Line 6.00 5
// Page 1 Line 7.00 6
// Page 1 Line 8.00 7
// Page 1 Line 9.00 8
//
// Top of Page 2
// Page 2 Line 2.00 9
// Page 2 Line 3.00 10
// Page 2 Line 4.00 11
// Page 2 Line 5.00 12
// Page 2 Line 6.00 13
// Page 2 Line 7.00 14
// Page 2 Line 8.00 15
// Page 2 Line 9.00 16