How to refresh a form

Is there a way to refresh a form? If I create a counter loop with a counter and update a label with the value of the counter, the label will not update until the loop has finished. I want to see the label changing as the counter changes, how do I refresh the form inside the loop to achieve this?

SetInterval. Change your label in a function called repeatedly.

Thanks for the reply. I can’t find anything in the Language Reference relating to SetInterval.
Can you please elaborate.

I found the reference to SetInterval under SetTimeout. It does what I need, thanks. It’s a bit odd that there isn’t a reference to SetInterval in the Language Reference index. Thanks again for your help lotsofcows.

I added a link for SetInterval in the index.

The form will not update until processing is complete. Use SetInterval to break the processing into smaller pieces, so the form updates between pieces.