_PageNo
This variable is that rare bird—a system variable that works in the most up-to-date way of getting output, but not very well in the older, obsolete ways. It contains the current page number and can be used to put the page number on a report. Although you can use it with ? and ?? output, _PageNo's value there is based solely on the number of lines output and _PLength—it doesn't notice when you issue EJECT (though EJECT PAGE does properly update _PageNo). With @..SAY output, we can't get anything sensible from _PageNo.
Usage |
_PAGENO = nPageNumber |
Example |
* To implement Page X of Y on a report, you * might use the following expression: "Page "+LTRIM(STR(_PAGENO)) * In the report footer, use an expression like the following: "Page "+LTRIM(STR(_PAGENO))+" of "+LTRIM(STR(nTotalPages)) * Then run the following code: PRIVATE nTotalPages REPORT FORM MyReport TO FILE Temp.RPT NOCONSOLE DELETE Temp.RPT NTotalPages = _PAGENO REPORT FORM MyReport TO PRINT |
See Also |