TOT(0 seems broke

George Simon GSimon at americanriverintl.com
Wed Mar 7 07:24:14 PST 2007



-----Original Message-----
From: Kenneth Brody [mailto:kenbrody at bestweb.net] 
Sent: Wednesday, March 07, 2007 9:57 AM
To: George Simon
Cc: Fplist
Subject: RE: TOT(0 seems broke

Quoting George Simon (Wed, 7 Mar 2007 09:40:22 -0500):
[...]
> Ken, is there any advantage to using:
> ga(9,,g)=tot(43) instead of ga(9,,g)=ga+43

In this scenario, they are basically equivalent.

However, you can use TOT() in other ways, such as

    xx = tot(foo) * tot(bar)

which is definitely not the same as

    xx = xx + foo*bar

(It is the product of the sums, not the sum of the products.)

It is also part of a set of aggregate functions, like MIN(), MAX(),
and AVG(), and may make for "cleaner" code.

Also, here's something you can do with TOT() that will delight and
confuse everyone here.   :-)

      If:  foobar eq "Y"
    Then:  xx = tot(foo)
      If:  foobar ne "Y"
    Then:  xx = tot(bar)

What would you expect "xx" to hold?  I'll tell you right away that
it is _not_ the same as

      If:  foobar eq "Y"
    Then:  xx = xx + foo
      If:  foobar ne "Y"
    Then:  xx = xx + bar

--

Is xx a global dummy?


More information about the Filepro-list mailing list