TOT(0 seems broke

Kenneth Brody kenbrody at bestweb.net
Wed Mar 7 06:56:59 PST 2007


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

--
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list