Question about checks for min and max values
Brian K. White
brian at aljex.com
Fri Jul 22 15:39:39 PDT 2005
----- Original Message -----
From: "Henry Melancon" <hemelancon at gifinc.com>
To: <filepro-list at lists.celestial.com>
Sent: Friday, July 22, 2005 8:25 AM
Subject: RE: Question about checks for min and max values
> 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.
>
> Henry
It's normal correct advertized designed documented behaviour.
It's not intrinsically more or less "right" than other possible semantics.
It provides conveniences in some situations just as it causes inconveniences
in some others.
I have places where I need to know the difference between "" and 0 too and
it's no big deal.
Just another one of the zillion little things a programmer may or may not
need to account for in any given situation as a basic facet of doing
programming in any language.
If:
Then: input popup scanimg_pc "How many sheets ?\n( 0-"{scanimg_mpc{",
Enter=1 ) \GZ"
If: scanimg_pc{"" eq "" ' this way if they hit return, they get "1"
Then: scanimg_pc = "1" ' but if they type "0" they get "0"
That's in a gosub and elsewhere I just accept and use scanimg_pc as a number
without any testing for special cases.
You think "" eq "0" is bad? You should have heard me when I first discovered
that "abcdefg" eq "abc" !
But even that is perfectly OK and logical and useful (actually _very_
useful) and doesn't get in the way or cause any problems as long as you know
about it.
Brian K. White -- brian at aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!
> -----Original Message-----
> From: filepro-list-bounces at lists.celestial.com [mailto:filepro-list-
> bounces at lists.celestial.com] On Behalf Of Jeff Harrison
> Sent: Thursday, July 21, 2005 9:23 PM
> To: Nancy Palmquist
> Cc: filepro-list at lists.celestial.com
> Subject: Re: Question about checks for min and max values
>
> --- Nancy Palmquist <nlp at vss3.com> wrote:
>
> > Jeff Harrison wrote:
> > > --- Kenneth Brody <kenbrody at bestweb.net> wrote:
> > >
> > >
> > >>Quoting Henry Melancon (Wed, 20 Jul 2005 12:36:44
> > >>-0500):
> > >>
> > >>
> > >>>The field types (edits) for fields 58 and 59 are
> > >>
> > >>both defined as type
> > >>
> > >>>"F".
> > >>>
> > >>>Filepro seems to be treating a blank field the
> > >>
> > >>same as zero. Is this
> > >>
> > >>>correct?
> > >>
> > >>[...]
> > >>
> > >>A blank numeric field will compare equal to zero.
> > >>You can explicitly
> > >>compare for blank by comparing for equal to "",
> > >>which will be true only
> > >>if the field is completely blank.
> > >>
> > >>--
> > >
> > >
> > > I did a test with two .0 edits and I found that a
> > > blank field is less than zero. However, with two
> > f
> > > edits they are equal. Is this a bug?
> > >
> > > For my tests I used the windows demo 5.010D9 DEMO
> >
> >
> [snip]
>
> > Lines 68 & 69 both test the null correctly and Lines
> > 70 and 71 do not
> > test null when they are equal to zero.
> >
> > These results do not match what Ken reported that
> > zero and null will
> > test equal. This is only true in some cases.
> >
> > Evidence is clear.
> > Nancy
> >
>
> Yes, it seems that Ken was wrong. I think that
> happened once before :-)
>
> Jeff Harrison
> jeffaharrison at yahoo.com
>
> Author of JHExport and JHImport. The easiest and
> fastest ways to generate code for filePro exports and
> imports.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
_______________________________________________
Filepro-list mailing list
Filepro-list at lists.celestial.com
http://mailman.celestial.com/mailman/listinfo/filepro-list
More information about the Filepro-list
mailing list