Re: Empty string?
Posted in 1997
In <33A0AC67.341CC73C@switchtech.net>, jkaplan wrote: >Why is it in my 4gl that when I compare a field with empty strings >against my variables which are empty strings, it doesn't come back >true. I found this after using conditionals to trace?? Kaplan, If you are talking about empty string like "", it is the very same as NULL valued string. In case of null values you MUST use is/is not null check. For example if "" have been assaigned to l_str : if ( l_str = "" ) then dislpay "Check is true" else display "Check is false" end if will always display "Check is false", it is the expected result, because any/most operations on null will result in a null and in case of if/conditional statement it will evaluate as false. What you need is probably : if ( l_str is null ) then dislpay "Value is NULL" else display "Value is not null" -- do additional checks here -- end if -- Have a nice day Felix K. Mathews mailto:fmathews@systems.dhl.com