Applies to: a Clarion 6 EE Legacy application (named in the thread); posted in the Clarion 6 group.
Problem
A batch process reads several input files and writes a TPS record for each input record. Its window shows a running count. At some point the counter is no longer displayed and the user sees no progress. The load runs in the Refresh Window embed in groups of 50 input records and then falls through until the accept cycle comes round again. Is there something to post so that the window is redisplayed, or a way to keep it on top?
Solution
- Call YIELD() inside the loop. The original poster used it and wrote that it appears to have fixed the problem.
- Why it helps, as a poster explained: Windows needs other threads to do background clean-up, which may include painting the window, so a loop that eats too much CPU time can make Windows misbehave. Control comes back automatically when the other ready threads are done. ACCEPT does the equivalent of a YIELD.
- The same poster also suggested a DISPLAY() in the loop, and advised programming as if the threading were non-preemptive.
- Another poster questioned the design and said a timer-driven process would let the window behave better.
Caveats
- A poster wrote that YIELD was said to do nothing in C6.0 with the newer threading model, but recent tests suggested it might now have a function.
- The original poster did not try the timer approach or DISPLAY().
Today (2026)
Releasing the CPU in a long loop is likely still sensible. Not re-tested on current Clarion.
Sources: Greg O. (Dec 2011, the question), Al R., Ben B., Carl S., Simon K. (Dec 2011 to Jan 2012) in softvelocity.public.clarion6.