Highlighted
Absent Member.
Absent Member.
270 views

[archive] Run background loop while waiting for mouse click?

[Migrated content. Thread originally posted on 14 August 2007]

Does anyone know if there is a way to run a loop while waiting for a mouse click?

Ex.. we have a teller waiting for a remote override. I would like to loop every 3-5 sec go see if the override is given and if so then have the teller click ENTER to accept. The problem is if the person giving the override is standing next to them and wants to do it on there screen then they need to be able to either start typing in their override creditials or click on something to stop the loop to be able to give the override.

Teller program takes W$BITMAP image of the current screen and saves it to a file. Then a window pops up at the bottome with Login: ____ Passwd:___ ENTER TO ACCEPT.

Teller then calls supervisor to ask for an override. Supervisor clicks an overrid button and the saved screen is displayed and the same program that is running the override window on the tellers screen is called so the Sup. can give the override.

The override is written to a file. This is the file that the program running on the teller side, needs to monitor so see if the override is given.

Thanks for any help,
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Run background loop while waiting for mouse click?

Hi miltonb,

Sounds to me like you need to get into THREAD processing. Start up a process in a separate thread that will detect the override while the main thread is looking after the user interface (mouse, screen etc.)

Something like:-
PERFORM IN THREAD
    CHECK-FOR-OVERRIDE
    HANDLE IN WS-THREAD-HANDLE.

In the CHECK-FOR-OVERRIDE you would detect the approval or rejection from the supervisor (using C$SLEEP to sit idle for short periods between checks) and set another working-storage variable. When this variable changes state, the main thread will be able to detect it and act accordingly.

The main thread should also be able to kill off the checking thread if the override is no longer required or if it has been entered at the tellers terminal.
STOP THREAD WS-THREAD-HANDLE

Ian
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Run background loop while waiting for mouse click?

Also, if you wanted to use a keystroke, you could use ACCEPT FROM INPUT STATUS.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.