Start a new topic

Global variable does not survive keyboard input

 I am experimenting with the new keyboard feature. In my HMI I have a global variable "target" that serves as a pointer to the currently edited input field (numeric or string).

That works nicely with my own routines to input numbers, but now I added a text component that shall be enterable with the new keyboard feature.

Starting off the keyboard works as well as text input, and with "OK" I get back to my page to find the entered text in the text component.

But my own target.val now is 0, regardless of what I do.

What happens here?

 you used the cov command to convert your text into a val?

No, it is numeric and stays that. In the touch event of the text component t6 I set "" and can prove it is set. I additionally set the loadpageid.val and the loadcmpid.val. The the keyboard page opens, I put in my text and tap on OK. Back on my original page, t6.txt has the input value, but target.val now is zero.


 and your "target" variable is also declared as global?

Yes, of course :-)


Ooops, found it! =:-o

My initial page has a preinitialization trigger containing "click 0,1". The referred touch press trigger then contained - among others - a "target.val=0" statement... I originally wrote the page as standalone, so that seemed to be safe, but now it gets re-initialized when I get back from the keyboard page. Time to think again :-)


Login or Signup to post a comment