Switching to running procedure

Hi

I have a dynamic user-menu with menu options and buttons based on individual user requirements.

Each time a button/menu-item is chosen the trigger fires an IP that runs whatever program is appropriate. The first thing the run program does is pass back its procedure handle to the user-menu, via another IP, which then maintains a combo-box that allows the user to switch between running programs at will without having to hunt down the right screen on the task bar.

All this works fine except if the user re-presses a menu button who's program is already running. The run statement in the button trigger is of course waiting for the program to terminate before continiung so whilst the button depresses, nothing happens.

My objective here is that if the user presses a menu button I want to match the menu option against the list of currently running programs and, if found, call an internal proc in the running program to restore itself with a WINDOW-STATE = 2 to bring it back into view, rather than running it again. I've got the actual logic to manage the restoring of windows working fine, it's the button issue that's go me stumped.

I guess I could run each program from the button clicks as persistent but somehow I don't think this a great idea.

Anyone got any ideas?

Cheers
Chris
 
I think that if you do want to do this kind of thing, running the procedures persistent is the only option. Having multiple procedures open with multiple wait-for statements is asking for trouble; Progress can loose track of where it is in each procedure (which wait for etc) that you have fired and the user has been using. If you have created proper event-driven procedures and kept any transactions in these procedures as small/short as possible, running the procedures persistent should not be a problem (make sure you remove the wait-for-s); I have created similar logic a couple of times myself.
 
Back
Top