Re: Is this a bug w/ 4GL 4.10
Posted in 1993
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... > ># bug.4gl ># --------------------------------- >globals >define x char(100) >end globals > >main > >let x = " " > ># below compiles but doesn't seem to do anything ># ># don't want to have to code: ># ># if x = " ... one hundred blanks" then > >if x clipped = "" then > display "x is blank" > end if > >end main It's three-valued logic, working as expected. Saying (if charvar = "") is logically equivalent to (if charvar IS NULL). We don't convert a value to NULL merely by clipping it, so for comparison purposes, the expression (blankvar clipped) still evaluates to a blank filed of zero length, conceptually. If you printed it, it should print nothing, but for comparison purposes, it still compares successfully to a blank field, e.g. if x clipped = " " then -- note the blank between quotes display "x is blank" end if *Does* display the text as expected. -- Alan Denney aland@informix.com {pyramid|uunet}!infmx!aland Disclaimer: Sender under influence of 1,3,7-trimethylxanthine "Lawyers use numbers like a drunk uses a lamppost: for *support*, rather than *illumination*." -- J. Peter Grace