i have a problem (bug?) with IIF-statement and boolean/usual values using Vulcan dialect.
Could you please check this?
1.) If the then-part or else-part uses a variable that is declared as USUAL and the value is FALSE, the negation of that value will lead to a wrong result.
I have the following demo code:
Code: Select all
LOCAL lValue2 := FALSE AS LOGIC
LOCAL lValue3 := FALSE AS USUAL
LOCAL lResult := FALSE AS LOGIC
lResult := IIF(FALSE, !lValue2, !lValue3)
// The result is 'false', expected is 'true' (--> !lValue3)
2.) If the result variable is also declared as USUAL, the result of the statement is undefined:
Code: Select all
LOCAL lValue1 := FALSE AS LOGIC
LOCAL lValue2 := FALSE AS LOGIC
LOCAL lValue3 := FALSE AS USUAL
LOCAL lResult := FALSE AS USUAL
lResult := IIF(lValue1, !lValue2, !lValue3)
// ??? The result is undefined, debugger shows "unable to read memory".
Code: Select all
lValue3 := TRUE
lResult := IIF(lValue1, !lValue2, !lValue3)
// The result is null (NIL)
Thomas