Quantcast
Channel: SCN : All Content - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 2935

PB 12.5.2 Build 5583 Winform: issue with SingleLineEdit modified (pbm_enmodified) event

$
0
0

Hi

 

We have few applications in PB classic 12.5.2 Build 5583. We are migrating them to PB Winform (under same version and Build of PB).

One issue that we have found is related to SingleLineEdit (SLE). And it looks like a bug in PB. The issue can be replicated in the following way by using any existing window -


1) Declare an Instance variable for the window

     long  il_4 = 0
2) Add a SLE control, say sle_1
3) Add a StaticText control, say st_1
4) Put the below code in sle_1.modified event -

 

long ll_1, ll_2, ll_3

If KeyDown ( KeyEnter! ) Then
     ll_1 = 10
     ll_2 = 100
     ll_3 = ll_1 + ll_2
End If

 

il_4 = ll_3 + il_4

 

Messagebox("ll_3 val", string(ll_3))

 

st_1.Text = string(il_4)

 

 

Now, run the above code using PB Winform target, the Messagebox displays 110 but the static text displays 220 ! If you run the same code in PB classic, both the Messagebox and static text shows 110 and that is correct.

 

Now come back to PB Winform, comment out the Messagebox. Run the application. It works fine. The issue is happening with the use of Messagebox object. I debugged the code and found that in Winform, when the cursor is at the line Messagebox and you try to step in, the cursor goes back to the beginning of the sle_1.modified event code instead of going to the next line (st_1.Text = string(il_4)). In SLE's modified event, when it encounters a Messagebox, the flow of code breaks and start re-executing from beginning of the event again.

 

Is it not wrong in PB Winform? Is there a fix available for this?

 

We even tried moving all the code from SLE_1.modified event to a Commandbutton and then call the button's clicked event from sle_1.modified. Same problem remains. In fact, if there is a Messagebox in anywhere in the subsequent codes which may get triggered by the call of sle's modified event, the problem comes up.

 

We are using Windows 7 Enterprise Service Pack 1 64 bit OS.

 

 

Thanks & Regards,

Mazibar


Viewing all articles
Browse latest Browse all 2935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>