I am sure as a PowerBuilder developer you have had requests to add a Progress Bar for a long running process. Also, the progress bar will definitely need to display which record is being processed at any point of time.
So naturally you will display a counter with some relevant information like maybe an invoice number or an employee id or similar unique key identifier that helps users to determine what record is being processed.
However, when you are running this process and the progress bar comes up and starts chugging along the counter, you may have noticed that if the application loses focus then the counter stops and you may see a ‘Not Responding’ message on the title bar. Here is how you can solve this annoying issue.
For i = 1 to dw_1.rowcount()
// Show Progress Bar
li_percent_index = (ll_company_row * 100) / ll_company_count
if isvalid(w_progressbar_common) then
w_progressbar_common.title = “Web Service”
w_progressbar_common.st_1. text = “Processing ” + string(ll_company_row) + ” out of ” + string(ll_company_count) w_progressbar_common.uo_1.uf_set_position(li_percent_index)
YIELD() — This call to the Yield function will keep your counter going steady even when you switch to any other application.