tags:

views:

164

answers:

2

I have a somewhat-long-running stored procedure being called from a PB application. I want the UI to show an indicator that it is processing, but I don't know the exact progress. That is, I can't say whether it is 10% or 90% done. All I know is when it is done.

To give the user something to look at I'd like to put a "Inderterminate" (horizontal) progress bar on the window somewhere. I've looked at the documentation for the built-in HProgressBar control and don't see how to force this behavior.

Short of writing my own control or importing another one, is there a way to accomplish this?

+2  A: 

Powerbuilder doesn't include a built-in way to do this, but you can use the Win32 controls. There is a good article on this (which includes an example of progress bars!) here:

It's an older article but it still applies to the newer versions of Powerbuilder.

Colin Pickard
A: 

Somewhat of a difficult situation to control. Since PowerBuilder is not multi-threaded the application UI won't be able to update properly when the stored procedure is running.

It will have to wait for the operation to complete before control is returned.

In the past, I've displayed an animation to illustrate that a long running operation is in progress. If you use the animation control it will continue to play while the SP running.

Brian Leslie
While you bring up a good point, it's not entirely accurate that PB is not multi-threaded. You can create threads with SharedObjectRegister(), and there's an Async DB Parm that may be applicable here. However, depending on where the weight of the performance impact is, the OP may want to spawn a thread to do the retrieve while the main thread runs the GUI. If the bulk of the overhead is in data transfer, this can be done in one thread with RetrieveRow, although this bears its own performance impact.
Terry