Linda,
What happens if you use = or eq... rather than <> in your test? If
false, then I think RBTI is trying to conform to "the rules" as far as
null goes.
David,
I don't think the issue is wether or not RBase is doing this
comparison correctly or not, the problem is that the comparison is
different.
Also,
> IF v1 <> v3 OR (v1 IS NULL AND v3 IS NOT NULL) THEN
looking at
OR (v1 IS NULL AND v3 IS NOT NULL)
if v1 isn't null and v3 is, wouldn't this become false, even though
you're still comparing a null to a non-null? You'ld still be reliant on
the first half of the OR which would have different results between
versions. And I routinely run out of expression space as it is.
I think a simple "If v1 = .v3 Then else" would do the trick, as it
should be false if a null was involved at all... but then there is all
that code to rewrite.
Ben Petersen
On 28 Jun 2001, at 9:17, david blocker wrote:
> Linda
>
> Since R:Base 3.0, I have been advising people that the most thorough way to
> check for not equals as well as NULL is by writing the code this way:
>
> SET VAR v1 TEXT = NULL
> SET VAR v3 TEXT = 'test value'
> IF v1 <> v3 OR (v1 IS NULL AND v3 IS NOT NULL) THEN
>
> You must test for BOTH. R:Base is doing it RIGHT. I'd suggest fixing your
> code and then reinstalling 6.5++ - it's WELL worth it!
>
> David Blocker
>
> ----- Original Message -----
> From: "FISHER" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, June 27, 2001 5:10 PM
> Subject: Null Warning - 6.5++ for Dos Upgrade
>
>
> > We just installed the latest upgrade this morning and had to uninstall
> > shortly thereafter in order to modify our code to account for the
> > correct handling of Null value comparisons.
> >
> > I had read the Bug Fixes and Enhancements at the time of the install
> > but didn't think that the change in how R:BASE was evaluating NULL
> > values would affect us since we were using the OFF EQNULL setting and I
> > knew that we rarely compared two null values. However, a change related
> > to the results of comparisons of null values to text values when EQNULL
> > is OFF wreaked havoc with our program flow. Below I have outlined the
> > results of comparisons of null values to text values by R:BASE in 6.1,
> > 6.5+ 6.5++ prerelease and 6.5++.
> >
> > SET VAR v1 TEXT = NULL
> > SET VAR v3 TEXT = 'test value'
> >
> > Version 6.5++ 6.5++ 6.5 + 6.1
> > Build 1.842 1.840 1.839
> > 6.1ax
> > IF v1 <> v3 THEN False False True True
> > IF v1 NE v3 THEN False True True True
> >
> > As far as I can tell, and I have done extensive evaluations with
> > INTEGER and DATE variables including BETWEEN and NOT BETWEEN checking,
> > the only change that occurred when EQNULL is set to OFF is with the
> > comparison of TEXT values as outlined above. Also, the reason we didn't
> > identify this when with the beta's is because we routinely use the NE
> > syntax instead of <>. Hopefully this will allow some of you out there
> > to plan for the upgrade better than we did.
> >
> > Linda Fisher
> > Manager, Data Services
> > CIMRO Quality Healthcare Solutions
> > 208 Metro Dr.
> > Jefferson City, MO 65109
> >
>
>