Very Confused

Kenneth Brody kenbrody at spamcop.net
Tue Nov 29 12:04:36 PST 2011


On 11/29/2011 12:58 PM, Del wrote:
> Greetings:
>
> I am writing an output process to copy data from one qualifier to another (processing only, no print).
> I am running it on a new HP PC operating under Windows 7, very fast.
> I have a show command that displays account numbers on the screen as it processes all the accounts.
> The idea is to give the end user something to look at to reassure them that the process, which takes a while to cycle through all the accounts, is actually running and not hung up – seeing the account numbers cycle on the screen does that.
> However, when I initially tested it, nothing showed on the screen.
> I went into debug mode to see what was wrong and the show command worked fine in debug mode (did not make any changes).
> I started to think that maybe the system was so fast that the show output never made it to the screen before it was wiped out by the next show command – is that possible?
> So I put a pushkey “[ENTR]” command just before the show command and an x=waitkey right after it.
> The idea being to actually slow it down a bit.
> Voila!  The show command then displayed on the screen just fine.
> But why did I have to do this?  And what should I have done?
[...]

Without seeing the actual code, I can't say why the PUSHKEY/WAITKEY would 
make a difference.  However, you could do the following to force a screen 
refresh every second:

First, declare a variable to hold the last time the screen was refreshed:

     declare LastTime(8,time,g)

Then, after the SHOW, add:

     If: @TM ne LastTime
   Then: LastTime = @TM ; video sync

(Or, if you want, place this in a subroutine which is called from several 
places in processing.)

Note that, by doing this every second, rather than every X records, you 
don't have to worry about slowing things down on fast systems.  For example, 
filePro used to update the *report countdown every 100 records.  However, on 
"modern" systems, this was so often that filePro was sending screen updates 
faster than the screen could be updated, and therefore things actually took 
longer to finish than necessary.  Now, the screen is updated once a second, 
regardless of how many records were processed.

-- 
Kenneth Brody


More information about the Filepro-list mailing list