Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread update TProgressBar during lengthy operation
Wed, Jan 13 2016 3:54 AMPermanent Link

Ronald

Hi,

I have a function which takes several seconds to complete, during this opreation I use a TPogressBar to show me the progress, but during the process the updates to the TProgressBar are not visible, only at the end of the operation I see the result. How can I update the TProgressBar durring the opreration?

Greetings,
Ronald
Wed, Jan 13 2016 4:41 AMPermanent Link

Rick

On 13/01/16 19:54, Ronald wrote:
>
> I have a function which takes several seconds to complete, during this opreation I use a TPogressBar to show me the progress, but during the process the updates to the TProgressBar are not visible, only at the end of the operation I see the result. How can I update the TProgressBar durring the opreration?
>
>

Have a look at the async keyword in the help. Basically you'll need to
break up your function into separate asynchronous type calls to pump the
message/function queue and show updates to the progress bar.

The Asynchronous Calls section in the help has examples.

--
Rick
Wed, Jan 13 2016 8:29 AMPermanent Link

Ronald

Rick wrote:

<Have a look at the async keyword in the help.>

Thanks, I will study and try it.

Greetings,
Ronald
Wed, Jan 13 2016 10:56 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ronald,

<< I have a function which takes several seconds to complete, during this opreation I use a TPogressBar to show me the progress, but during the process the updates to the TProgressBar are not visible, only at the end of the operation I see the result. How can I update the TProgressBar durring the opreration? >>

Unless the operation is strictly UI-related, then this is normally a sign that you should move such processing to the back-end web server functionality.  Executing long-running processes on the client side can result in dialogs popping up in the browser that may prompt the user to suspend JS execution, which is not good for your application.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Jan 13 2016 11:17 AMPermanent Link

Ronald

Tim Young [Elevate Software] wrote:

<Unless the operation is strictly UI-related, then this is normally a sign that you should move such processing to the back-end web server functionality.  Executing long-running processes on the client side can result in dialogs popping up in the browser that may prompt the user to suspend JS execution, which is not good for your application.>

You are right and I was thinking about that indeed, until I used TTable.DisableControls....

Ronald
Image