Re: Is this a bug w/ 4GL 4.10
Posted in 1993
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
In article <1993Jul29.203515.28443@ra.oc.com> jmaddox@mistxt.oc.com (John Maddox) writes: > >The following program compiles but does not work as i expect... >Is it me? (or is this a bug?) > > ># bug.4gl ># --------------------------------- >globals >define x char(100) >end globals > >main > >let x = " " > >if x clipped = "" then > display "x is blank" > end if > >end main I just compiled and ran the following code: MAIN DEFINE x CHAR(10) LET x = " " IF x CLIPPED IS NOT NULL THEN DISPLAY "x CLIPPED is not evaluated to NULL" END IF IF "" IS NULL THEN DISPLAY "Yup, empty quotes are seen as being null." END IF END MAIN And, as I had suspected, both messages were displayed confirming the fact that empty double quotes ("") is evaluated to NULL, and a clipped string is not. So, the output of your orignal program was correct in evaluating x clipped = "" as being false. However, the question as to whether "" should be evaluated as being null is viable. I could see how "" could represent a string that is present, but with nothing in it. This is a bit different from the idea of NULL. Anyway, I hope this helps. :-) john... _ \\__ /( __> //| \\ ///___) Shadowfax... -- john... From: jcfowler@david.wheaton.edu (Shadowfax...) _ \\__ /( __> //| \\ ///___) Shadowfax...