"page "+_pageno + " of "+transform(myvar)... where myvar is the variable declared in the calling program, or a member of your app object, or whatever you prefer to use.
LPARAMETERS the_report, the_clauses * this program is used to * execute reports that require * a page total. * [... continue doc'ing here, * explaining that the variable * declared here is used in report * expressions ... ] LOCAL currwind currwind = WONTOP() PRIVATE myvar * doesn't have to be a private var, * could be a property of a global * object, for example myapp.myvar myvar = 0 DEFINE WINDOW x FROM 1,1 TO 20,20 ACTIVATE WINDOW x NOSHOW REPORT FORM (the_report) &the_clauses * do it with the NOSHOW window rather than NOCONSOLE * because under certain conditions * NOCONSOLE won't give you the right page count * -- also it is fast this way * at this point both _pagetotal and _pageno are the correct * value, so you can do this: myvar = _pagetotal * or myvar = _pageno, same thing really RELEASE WINDOW x IF EMPTY(currwind) ACTIVATE SCREEN ELSE ACTIVATE WINDOW (currwind) ENDIF REPORT FORM (the_report) &the_clauses TO PRINT>L<