- Peter Thiem
- PowerBuilder
- Wednesday, 13 October 2021 02:50 AM UTC
Hi,
I am upgrading an application from Powerbuilder Classic 12.5 to Powerbuilder 2021 (build 1288).
For me, the case statement malfunctions and returns false, when a long pointer is the "testexpession" and a constant integer is the "expressionlist", when I was expecting it to return true.
This pattern is used in this application in using the message.wordparm variable to decide how to handle message.
A minimal example is as follows:
// Demonstrate CASE statement does not work comparing LONGPTR to CONSTANT INT
longptr ll_longptr = 177
int li_int = 177
CONSTANT int li_int_constant = 177
CHOOSE CASE ll_longptr
CASE li_int
MessageBox("Alert", 'll_longptr = li_int') // This does occur. NON-constant integer.
END CHOOSE
CHOOSE CASE ll_longptr
CASE li_int_constant
MessageBox("Alert", "case ll_longptr = li_int_constant") // This does not occur. CONSTANT integer
end choose
I find it unexpected that a constant behaves differently from a non-constant in this example.
Is this an expected behaviour, a known defect, depends on the 32/64 bitness of the execution, or affects only me perhaps, or example is faulty?
In any case, I will just work around it for now.
Cheers, Peter
PS. In powerbuilder classic 12.5, message.wordparm appears to be Long, rather than Longptr, and the application was fine.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.