Question about checks for min and max values

Nancy Palmquist nlp at vss3.com
Thu Jul 21 14:46:17 PDT 2005


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


───────────────────────────────────────────────────────────
  60  -------   -   -   -   -   -   -   -   -   -   -   -
@key9  ◄ If:
        Then: na(10,.0)="" ;nb(10,.0)="0"
  61  -------   -   -   -   -   -   -   -   -   -   -   -
        ◄ If:
        Then: nc(10,F)="";nd(10,F)="0"
  62  -------   -   -   -   -   -   -   -   -   -   -   -
        ◄ If: na eq nb
        Then: msgbox "Null eq 0 (10,.0)"    'tested FALSE
  63  -------   -   -   -   -   -   -   -   -   -   -   -
       ◄ If: na lt "0"
        Then: msgbox "NULL < ZERO LITERAL"         'tested FALSE
  64  -------   -   -   -   -   -   -   -   -   -   -   -
        ◄ If: na eq "0"
        Then: msgbox "NULL TESTED EQUAL to 0"    'tested TRUE
  65  -------   -   -   -   -   -   -   -   -   -   -   -
        ◄ If: na lt nb
        Then: msgbox "na < nb  or \"\" < 0"   'tested TRUE
  66  -------   -   -   -   -   -   -   -
        ◄ If: nc eq nd
        Then: msgbox "NC = ND (10,F)"         'tested TRUE
  67  -------   -   -   -   -   -   -   -
        ◄ If: nc lt nd
        Then: msgbox "NC < ND (10,F)"         'tested FALSE
  68  -------   -   -   -   -   -   -   -   -   -   -   -
        ◄ If: nc eq ""
        Then: msgbox "NC(10,F) is NULL"       'tested TRUE
  69  -------   -   -   -   -   -   -   -   -   -   -   -
        ◄ If: na eq ""
        Then: msgbox "NA(10,.0) is NULL"      'tested TRUE
  70  -------   -   -   -   -   -   -   -   -   -   -   -
        ◄ If: nd eq ""
        Then: msgbox "ND(10,F) is NULL"       'tested FALSE
  71  -------   -   -   -   -   -   -   -   -   -   -   -
        ◄ If: nb eq ""
        Then: msgbox "NB(10,.0) is NULL"      'tested FALSE

Line 64 tested true because the variable was compared to a literal 0 not 
a data field with an edit.

Line 65 - it looks like a null is less than 0 when using a .0 edit

Line 66 - but equal if using the F edit.  Not sure if I consider that 
consistent.

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



-- 
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