Can someone please help me with the Timer function?
I need to capture the text in an editline control every second, and then process this text.
Thank You,
David Nowak
David,
Can you provide some more detail on what you actually need to accomplish? I want to make sure you are getting exactly what you need. For instance, does this process need to happen every second even if the end user hasn't changed anything?
By the way, I assume you are really asking for help with the TIMER event and property. They work together. Have you already looked them up in the Programmer's Reference Guide?
The application will receive its input from a barcode scanner that will be "wedged" into the keyboard. Functionally, the computer cannot discern the difference between a serial code typed into the keyboard or scanned. The program should poll an edit line every second to see if any character data is present. If it is, it will hold it through the next timer iteration to ensure that it received all of the input. Once the application has detected that a complete scanned event has occurred the timer is turned off, the processing of the data occurs, and then the timer is reactivated. The entire purpose of this particular application is to react to data that is scanned into an edit line.
I have used the same approach with Visual Basic programs in the past with success.
I read the programmers reference relative to this, but I cannot get this feature to work at all.
Thank you for your help.
David Nowak.
David,
The process is relatively simple. First, turn on the TIMER functionality by setting the property:
rv=Set_Property(@Window:".EDL_SCANCODE", "TIMER", 1000)
You would probably execute the above code initially in the CREATE event of your form. The "1000" refers to how many milliseconds the TIMER event will execute (i.e. once every second.)
Then you should be able to put your polling logic within the TIMER event of the editline control itself (either using the script or QuickEvent). Most likely you will use a common variable or user-defined property to store the previously known contents of the editline so you can compare with the current contents. That way you can decide if all the input is received.
Once this condition has been met you can disable the TIMER event by setting the value to 0. When your processing logic is done then set the TIMER property again with the value of 1000.
We also use a wedge barcode reader. We configured the barcode reader to append a on the end of the scan. When an item is scanned, the data displays in the editline and the sets the focus to the next control in the tab list. We use an OK button after the editline which has has a gotfocus event. The gotfocus event processes the newly scanned data and returns the focus back to the editline. Hope this helps - Sandra
Sandra,
I was going to suggest that as well but this seems like a system that has already established a protocol for how their scanners are configured. Your approach, by the way, is very similar to what we do.
Thank you all for your help. I have it working now. As for the suggestion of appending the CR to the serial number, I had not considered this approach–kind of fell into the "this is the way we have always done it" syndrome.
Thanks Again,
David Nowak.