Questions? Feedback?powered byOlark live chat software
Bug 2272

Problem with LongPtr datatype 12 February, 2019

Roland Smith
11 February, 2019
Product: PowerBuilder Category: PowerScript
Version: 2019 Beta Publishing: Public
Status: Scheduling Priority: P3
Classification: Sybase (legacy) bug Resolution:
Ken Guo 12 February, 2019
Hi Roland,

Thanks for the information. We’ll get back to you here if there’s any progress. 

Regards,
Ken
Roland Smith 11 February, 2019
I tried running a profile to see why it was slow and now it isn't slow. I've made a change to my code to get around the problem so it isn't urgent but this should still be corrected if it isn't too difficult.
Roland Smith 11 February, 2019
sizeof.zip (16KB)

I tried that and it calls the longptr function for both. Attached is a demo app that calculates the size of structures. I have two user objects, one with longptr after long and one with it before. It should result in 16 in 32bit and 20 in 64bit if it were working as expected.
Also, running it from the IDE is very slow while the exe is fast. I'm not seeing that in older versions of PowerBuilder.
Ken Guo 11 February, 2019
Hi Roland,

Thanks for reporting this problem! We reproduced it on our end and will do further research to figure it out. We will keep you posted about the progress.

Please work it around this way currently: please delete the functions that use long parameter, and then add this function again, i.e. first create the functions that use longptr parameter, and then create the functions that use long parameter. 
 
Regards,
Ken
Roland Smith 11 February, 2019
I noticed this in 12.6 and then checked the beta and it gives the same result.
Roland Smith 11 February, 2019
When an object has two functions with the same name but the arguments have a different datatypes, it is supposed to run the version of the function that matches the datatypes passed.

I have discovered that when the datatype is longptr, it always chooses the function with the long. This happens in 32bit and 64bit exe as well as 32bit through the IDE.

To reproduce, create a target with a window. Create two functions with the same name, one has one argument of type long and a second one has one argument of type longptr. Add a button that calls both functions. In each function, add a MessageBox with datatype as the title and the value passed as the message. Compile to 32bit and 64bit. Both exe and the IDE will display the long message.
OS:
All 
Platform:
 
Database Type:
 
Database Version: