Re: 4GL compares NULL differently
Posted in 2005
minnickbrian@aol.com — — source: Usenet: comp.databases.informix
This has been a know issue with decision statements in 4gl as far as I can remember back in to the early 90's. If the variable has any possibility of being null then it should be checked as part of the condition first: IF m_inv_amt is NULL or m_inv_amt != 0 then RETURN true ELSE RETURN false END IF unless you want it the other way then IF m_inv_amt is NOT NULL and m_inv_amt != 0 then RETURN true ELSE RETURN false END IF > > DEFINE m_inv_amt DECIMAL(12,2) > > > > FUNCTION AmtUsed() > > > > IF m_inv_amt != 0 THEN > > RETURN true > > ELSE > > RETURN false > > END IF > > END FUNCTION sending to informix-list