Question about checks for min and max values
Nancy Palmquist
nlp at vss3.com
Fri Jul 22 10:10:29 PDT 2005
Henry Melancon wrote:
> So is this Filepro behavior normal or is this a bug? How do other data base programs handle a situation like this? I do not like the fact that a "blank" and zero are treated equal in some cases.
>
I would say that it is as expected - mostly.
It can be confusing, I know.
Here are basically the rules I use:
1) always compare like types -
aa eq ab where aa(8,.2) and ab(8,.2) - like that
it is not the same type when you do the following:
aa eq "2.5"
filepro has to convert the 2.5 to a type of it's choosing (likely to be
the same as aa, but this ascii to binary convertion can sometimes give
unpredicible results, where it might not test true or false when it
looks like it should.
Also:
ab(8,*)="2.5" will never test equal to aa(8,.2)="2.5"
aa ne ab - this will never be true because you are comparing:
"2.5 " eq " 2.50"
These will not ever work correctly.
3) aa=aa+"0" will change "" to "0" -
When you are keeping a total, and instead of increasing and reducing the
number, for some reason you reset it to zero, many programmers will just
blank it. These will values, "" and "0" will be treated as the same for
calculations and most purposes.
4) In a calulation, precision and accuracy can affect the outcome.
Precision refers to how many decimal places are given in the number.
If I have 1 1/2 apples, and represent that with 1.50000 - I am
indicating how well I measured the half by giving the additional
precision. I would find that hard to justify when just cutting an apple
in half. I would have to use much better measurement tools to provide a
measurement to 100,000ths.
Accuracy refers to the number of places that provide actual data. In
our apple case, the 1.5 would indicate the correct accuracy for our
number not 1.50000.
For calculations, it may be necessary to add precision to provide places
for rounding but the final answer should be represented only to the
accuracy of the least precise value.
(Sorry - I regressed back to my teaching days. Please forgive me.)
DATE ASIDE:
I have had issue with dates stored with dashes instead of slashes
testing and indexing true. My solution is simple, on any date that the
end user can enter, I add this type of wlf for that date. Then they can
type what they want - I always get what I want.
@wlf12 '12 is (8,mdy/)
if 12 ne ""
then: 12=12+"0";display
then: end
This will change the date to the slash format very easily.
Nancy
--
Nancy Palmquist MOS & filePro Training Available
Virtual Software Systems Web Based Training and Consulting
PHONE: (412) 835-9417 Web site: http://www.vss3.com
More information about the Filepro-list
mailing list