| If you have a long process that you want the user to be able to interrupt,
you can show a response window with a cancel button on it. When the user presses the
cancel button disable the button and sent an instance Boolean variable to TRUE. Then in
your main loop check the flag at the top of the loop. Then throughout your code add the Yield()
command. This makes a PowerBuilder script yield processing to other tasks for a short
period of time. Just enough processor power so accept a clicked event on a button and set
a flag.
This will only work if your processing is all Powerscript. If your program calls a DLL
or the Database then you have no control over the program flow and you will be out of
luck. |