Hello,
We're experiencing an odd issue with computed expressions, specifically the following.
Why does this expression equate to 1:
IF(NOT (1=1) AND (1 = 2), 1, 0)
While this expression correctly equates to 0:
IF( (1 = 2) AND NOT (1=1), 1, 0)
If anyone can shed some light, that would be greatly appreciated.
PowerBuilder 2019 R2 Build 2328
I've attached an exported datawindow that demonstrates this odd behaviour.
Regards,
Greg
CASE 2: dataobject is attached but no row was inserted
following is copy/paset of the messagebox
result is always true
---------------------------
NOT dw_777.RowCount() > 0
---------------------------
TRUE-part
---------------------------
OK
---------------------------
---------------------------
NOT (dw_777.RowCount() > 0)
---------------------------
TRUE-part
---------------------------
OK
---------------------------
CASE 4: Integer age when SetNull(age)
result is always false
following is copy/paste of messagebox
---------------------------
NOT (age > 0)
---------------------------
FALSE-part
---------------------------
OK
---------------------------
---------------------------
NOT age > 0
---------------------------
FALSE-part
---------------------------
OK
---------------------------
CASE 5: Integer age when age = -1
result is always true
following is copy/paste of messagebox
---------------------------
NOT (age > 0)
---------------------------
TRUE-part
---------------------------
OK
---------------------------
---------------------------
NOT age > 0
---------------------------
TRUE-part
---------------------------
OK
---------------------------
if your objective of using NOT is to cover all the sides(including null and less than zero) with just one condition. Certainly that will fail because PowerBuilder IF condition behaviour is not perfect. I already had doubts and found your post. So checked NOT today. :)
Thank you.