tot() in @wgt
Richard Kreiss
rkreiss at gccconsulting.net
Fri Nov 19 06:56:23 PST 2010
Dan,
Another suggestion is to replace tot(nn) with an array to hold the totals
needed. The at @wgt set the dummy fields to the values in the array
elements.
If:
Then:Dim totals(5)
If:
Then: totals["1"]=totals["1"]+nn nn is the filed number to be totaled
and is done on each record processed
@wgt:if:
Then:aa=totals["1"];ab=totals["2"]; .............................
I have used this technique especially where is have had to accumulate
different totals for each break especially where some calculations are
necessary.
Richard Kreiss
GCC Consulting
rkreiss at gccconsulting.net
> -----Original Message-----
> From: filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com
> [mailto:filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com] On
> Behalf Of Bruce Easton
> Sent: Friday, November 19, 2010 9:31 AM
> To: filepro-list at lists.celestial.com
> Subject: Re: tot() in @wgt
>
> Dan, put your assignments using the tot functions to the section of your
> output prc table that will execute for each record. (And after where ever
> you assign 'og'.) Also make the dummy fields that you assign from tot
> functions global - for example, 'tp(12,.2,g)=tot(43)'.
>
> Bruce
>
>
> Bruce Easton
> STN, Inc.
>
>
>
> On 11/18/10 10:01 PM, Dan McCabe wrote:
> > Hello,
> >
> > Please forgive me if this is a stupid question, but I've been away
> > from programming for a couple of years now, but have been asked to
> > create a new report for payroll. The processing takes real fields and
> > does some formatting and combines a couple with simple math to. At
> > the end, in the grand total section of the output, I am trying to
> > display the total value of some of the fields.
> >
> > The report runs on each record and appears to be working as intended.
> > That is until I get to the @wgt section. In the debugger, I find that
> > the only info in the @wgt is the value in each field of the last record
rather
> than
> > the combined total of the 100 or so before. The processing is posted
> > below. Am I doing something wrong here?
> >
> > @wgt If:
> > Then:
> > 96 ------- - - - - - - - - - - - - - -
- -
> > If: 'Payroll hash totals
> > Then: tp = tot(43)
> > 97 ------- - - - - - - - - - - - - - -
- -
> > If: 'Regular dollars
> > Then: rd = tot(18)
> > 98 ------- - - - - - - - - - - - - - -
- -
> > If: 'Total out of grade
pay
> > Then: go = tot(og) 'og combines two real fields
in
> > this file.
> > 99 ------- - - - - - - - - - - - - - -
- -
> > If: 'Total S.A.M.
> >
> > Then: sm =
> > tot(41)
> > 100 ------- - - - - - - - - - - - - - - -
-
> > If: 'Total uniform
allowance
> > Then: ua =
> > tot(21)
> > 101 ------- - - - - - - - - - - - - - - -
-
> > If: 'Total overtime
> >
> > Then: od =
> > tot(26)+tot(28)+tot(30)
> > 102 ------- - - - - - - - - - - - - - - -
-
> > If:
> > Then:
> > end
> >
> >
> > Thanks,
> >
> > Dan McCabe
> > -------------- next part -------------- An HTML attachment was
> > scrubbed...
> > URL:
> > http://mailman.celestial.com/pipermail/filepro-list/attachments/201011
> > 18/c2bce0eb/attachment.html
> > _______________________________________________
> > Filepro-list mailing list
> > Filepro-list at lists.celestial.com
> > Subscribe/Unsubscribe/Subscription Changes
> > http://mailman.celestial.com/mailman/listinfo/filepro-list
> >
> >
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
More information about the Filepro-list
mailing list