Re: 4GL compares NULL differently
Posted in 2005
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
Denis Melnikov wrote: > 4GL 7.32.UC2 > Solaris 2.6 > > 4GL must compare NULL to any not-NULL value as FALSE. > And it acts this way... sometimes. > > Please review the following sample: > > > DEFINE m_inv_amt DECIMAL(12,2) > > FUNCTION AmtUsed() > > IF m_inv_amt != 0 THEN > RETURN true > ELSE > RETURN false > END IF > END FUNCTION > <<<<<<<<<<<<<<<<<< > > When m_inv_amt is NULL, AmtUsed() returns FALSE at one moment, > and TRUE at another. And the FALSE/TRUE sequence doesn't > change from run to run. > > Is it a known bug or a new feature? > > Look at Jonathan Leffler answer. Also bare in mind that in compiled 4GL the variables AFAIK aren't guaranteed to be null before initialization... I recall hitting a bug with some IF statements and null values but it had to do with datetime values. Regards.
have you contacted your support provider? I think there may have been a fix made for this fairly recently.