Re: Null string comparison.
Posted in 1999
---- you wrote: > > --------------D8481D7E153812A0B5543C52 > Content-Type: text/plain; charset=us-ascii > Content-Transfer-Encoding: 7bit > > JouhShenToh@pg.SLR.com wrote: > > > If I have two char(1) variables A and B, I need to do some actions when the > > two variables differ. I used > > IF A<>B THEN > > LET lnCount=lnCount+1 > > ELSE > > DISPLAY "Same values" > > END IF > > > > When 1 of the variable is null, I will get "Same values" which is not true. > > How to overcome this null comparison problem? > > > > Thanks. > > I think you've got to explicitly test for null > > IF (A<>B) AND A IS NOT NULL AND B IS NOT NULL THEN > LET lnCount=lnCount+1 > ELSE > DISPLAY "Same values" > END IF A question AND answer in one post. Cool dude! AB ---------------------------------------------------------------- Get your free email from AltaVista at http://altavista.iname.com