[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: End-of-file on SELECT



Denise,

This is a different way of approaching it so that you don't need to know
when the select is done.  What I often do when I need a single page-break
after multiple possible "after/total" breaks is to use a numeric as a
logical flag and the before= option. Something like...

   move 0 to #need_new_page
   begin-select
   xxx    &x () on-break print=never before=pre_x after=post_x level=1
   yyy    &y () on-break print=never before=pre_y after=post_y level=2
      ... yadda yadda yadda
   end-select

And then have sections in the before and after procs like....

   begin-procedure pre_x
      if #need_new_page
         new-page
         move 0 to #need_new_page
      end-if
      ! Store "heading" values
      ........ yadda yadda yadda
   end-procedure

   begin-procedure pre_y
      if #need_new_page
         new-page
         move 0 to #need_new_page
      end-if
      ! Store "heading" values
      ........ yadda yadda yadda
   end-procedure

   begin-procedure post_y
      move 1 to #need_new_page
      ........ yadda yadda yadda
   end-procedure

   begin-procedure post_x
      move 1 to #need_new_page
      ........ yadda yadda yadda
   end-procedure

Notice the comments about storing heading values.  Because this fires off
the new-page in the "before=", you need to specifically save the heading
values into variables since the "save=" option will have already reset.

Using this, you could have 7 different break levels, all with totals, and
all the totals needed would print on the same page, then 1 single new-page
would fire off, but only if there were more returns from the select.

HTH,
-----------------------------------------------------------------------
Donald Mellen  | Ray Ontko & Co. - Richmond, IN - http://www.ontko.com/
donm@ontko.com |  "In the beginning, there was nothing, which exploded"