[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Page 1 of xx
- Subject: Page 1 of xx
- From: Suzanne MacLaughlin <ssmacl@YAHOO.COM>
- Date: Thu, 1 Oct 1998 10:53:43 -0700
There is a relatively easy way to accomplish the page numbering. My
client has the same request to have multiple reports in one .lis with
each one having 1 of xx (for each invoice).
I was able to accomplish this by creating an array
create-array name=array size=500
field=lastpg:number
and using it for substitution in the original .lis file. The header
will contain
print 'Page No.' (,+2)
print #page-count (,) edit 999
let $lastpage = ' of @@' || to_char(#array_pos)
print $lastpage (,+1)
which will be the position within the array. The array will have the
value that is to be replaced. When the report is complete, the report
is closed and the following will replace the array position with the
actual number of thru pages.
move $sqr-report to $save_report
new-report 'junk.lis'
open $save_report as 1 for-reading record=190:vary
let $output = $save_report || '.new'
open $output as 2 for-writing record=190:vary
while 1
read 1 into $string:190
if #end-file
break
end-if
if instr($string,'@@',1)
unstring $string by '@@' into $page $marker
if $marker <> $oldmarker
let $lastpage = to_char(array.lastpg(to_number($marker)))
move $marker to $oldmarker
end-if
let $page = $page || $lastpage
write 2 from $page
else
write 2 from $string
end-if
end-while
close 1
close 2
let $cmd = 'rm ' || $save_report
Call system using $cmd #status
Suzanne MacLaughlin
COAD Solutions
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com