I've been watching all various replies and comments on this topic and would like to make an observation and a request:
The observation: something changed in one of the patches to v6.5 to change the way EQNULL works. I know because a report of mine that had been working fine stopped working. The solution from RBTI was to change the EQNULL setting to ON when it had been OFF. With Dennis' original code the EQNULL setting made no difference when I tried it but Razzak's code is different - a variation on the theme but not the same. The request: please make sure if anything is "fixed" for EQNULL that we know about it and the effect any changes might have. The change in the v6.5 patch seemed to creep out without jumping up and making itself clear what it was going to do!! By the way, if anybody can explain in easy to understand words of one syllable what the change to EQNULL in v6.5 was I'd like to know - I'm not keen on just changing a setting without really understanding why it needs to be different. Regards, Alastair. ----- Original Message ----- From: "A. Razzak Memon" <[EMAIL PROTECTED]> To: "RBASE-L Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, October 07, 2003 8:49 PM Subject: [RBASE-L] - Re: Problems with ZERO ON - Razzak's Reply > > Dennis, > > What's the settings for EQNULL ? > > Correct evaluation of expressions when EQNULL is SET to ON. > > R:BASE 6.5++ (Build:1.866xRT03 and higher) > > R:BASE uses special processing on simple IF commands for maximum > speed. However, the way these were processed was not consistent > with the way complex IF commands or WHILE commands were processed > with regard to comparisons using NULL values. The EQNULL setting > at TRUE means that a comparison between two NULL values is a match > and that a comparison between a NULL value and a non-NULL value is > not. When EQNULL is set to FALSE then a comparison between two NULL > values is not a match nor is a comparison between a NULL value and > a non-NULL value a mismatch. The NULL value essentially make the > whole thing "unknown'. This behavior was followed in WHILE and > complex IF commands but was not followed in simple IF commands. A > simple IF command has only one comparison and the left side is a > simple variable and the right side is either a variable or a > constant. A simple IF does not have any expressions. > > Compare these code samples: > > SET VAR v1 TEXT = NULL > SET VAR v2 TEXT = NULL > > SET EQNULL OFF > IF v1 = .v2 THEN > -- will not be a hit > ENDIF > IF v1 <> .v2 THEN > -- will not be a hit > ENDIF > IF v1 <> 'This' THEN > -- will not be a hit (it used to be before this fix) > ENDIF > > SET EQNULL ON > IF v1 = .v2 THEN > -- will be a hit > ENDIF > IF v1 <> .v2 THEN > -- will not be a hit > ENDIF > IF v1 <> 'This' THEN > -- will be a hit > ENDIF > > Before this fix, the comparison "IF v1 <> 'This' THEN" would be > a hit with EQNULL set ON or FALSE when it should only be a hit > when EQNULL is ON. This means that now: > > "IF (.v1) <> 'This' THEN" and "IF v1 <> 'This' THEN" > > will both process the same way. In the past they would be > different because of this problem. > > In your code if you want the comparison of a NULL variable and > a non-NULL constant to be a hit then you should run with EQNULL > set ON. > > In your code if you want the comparison of a NULL variable and > a non-NULL constant to be a hit then you should run with EQNULL > set ON. > > Let me know how that goes ... > > Hope that helps! > > Very Best R:egards, > > Razzak. > > > > At 12:42 PM 10/7/2003 -0700, Dennis McGrath wrote: > > >I've got a problem has me stumped. I have a client where SET ZERO is > >always ON. I won't go into the details, but this is a must. > > > >Running the latest patch of 6.5++ both DOS and Win. > > > >I need to test a column (REAL) on several entry forms to see if it is > >NULL or zero. Seems the ISNULL function is not up to the task. Here is > >some demo code: > > > >set null -0- > >set zero on -- required > >set var vreal real = null > >set var vtest = (ifnull(.vreal,'is null','is not null')) > >wri .vreal, .vtest > >wri ' ' > >set var vreal real = 0 > >set var vtest = (ifnull(.vreal,'is null','is not null')) > >wri .vreal, .vtest > > > > > >vTest always = 'is null' > > > >Anyone have a magic bullet that will solve my problem? >

