Animated GIF in tight report/process loop

When I have a tight loop for processing records on a report or process (hand coded) my animated gif showing report is processing does not work. And that seems reasonable since I am not giving other CW events to process. YIELD does not affect the current thread only gives time slices to other CW threads and other windows processes.

When we have an unknown number of records to process the progress bar does not give accurate feedback and using a straight 1-100 bar and resetting every 100 records is too much “noise” for the user.

I already show a string field showing each record’s account/name being read, but this also slows the system down with displaying that one field over and over on a window.

What do others do to show progress in such a situation?

Check this Ingasoftplus : EasyAnimation 1.02 by Ingasoftplus

Hi Kevin,

You have a few options here. which one you decide on is up to you.

a) I’ve never found the animated gif thing to be useful. It doesn’t really give you confidence. (As evidence, when you see the clarion spinning disc do you think “oh, good, it’s still working” ?)

b) You can clock the time on your DISPLAY of account name, or whatever. Let a few seconds go past before updating it. In other words, don’t show every one, but refresh the field every 3 seconds or so. That way the user sees “progress” - we were on Bruce, now we’re on John, and so on. In your situation this is likely the fastest one to implement, and effective.

c) Do better on the progress bar. Again, only update it when it changes (not every loop). But while you may not know the exact number of records, you may know some “range”. For example when the primary loop is on say names then you can progress from 1 to 26, updating by one every time the lead letter changes. Of if on dates, then the date range. And so on. The progress doesn’t have to be smooth. It might take longer on the M’s than the Z’s, but it reflects “progress”. This is the most useful one to the end used.

d) There’s also the ThreadWorker class which allows progress to be handled by this thread, as the work is done on another thread. But this is likely overkill for this situation.

1 Like


I hear you and you are preaching to the choir. But this client has ideas of their own and I tried to explain to them that like you said in

A - an animated GIF in itself does not really show anything is happening.
B - Doable
C - We have 1.8 million (yes million) invoice records and the key for Invoices with balances can not be OPT (which would gives us those w/ flag on, but it has account in the key to so no RECORDS() benefit)
D - Don’t want to go there

After posting this we decided to Set the High Range to 500, then every 500 records reset the counter to give a pulsing progress. It is slower than the 100 range flash on the screen.

Great suggestions as usual though.

1 Like

You could take a look at my post below. A Marquee style Progress is for an unknown number of records, it is basically an animation.


Thanks. But as you noted…

Sadly my tests show the bar stops moving when the program blocks the accept loop.


Communication is the key to a successful relationship.