Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My Timer Freezes my clock .... 1

Status
Not open for further replies.
Apr 25, 2002
156
0
0
GB
Hi

When i am scanning files i have a timer on a form that checks the time and updates the clock. What happens here is that my clock freezes until i finish the process .... sometimes this takes 5m to 10 mins - and then the clock jumps to the new time.

What i need is the command to stop this from happening any takers ?

roadrunner
 
Issue DOEVENTS FORCE during the loop.

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
Be careful though, DOEVENTS can take a while.

If you have it is a large (number of iterations) loop your process will slow down too much. You could just make it DOEVENTS every fifty iterations or somesuch.



Regards

Griff
Keep [Smile]ing
 

Borislav,

Are you sure about the FORCE clause? My understanding is that this will cause the application always to wait for an event, rather than just check to see if an event is pending. But I'm not sure.

Griff,

You're right to point out the performance hit, and to suggest doing it every so-many iterations. However, this is much less of an issue in recent versions of VFP than it was originally.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,
you are right, FORCE is not the way, according to help it will stops executing (I have some DOEVETS FORCE in my application and didn't notice such behaviour though) just DOEVENTS is enough.

Griff you are also right to put DOEVENTS to be executed not always.

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
Whether you need FORCE or not depends on the version of VFP. In VFP 7, DOEVENTS doesn't allow a repaint. In VFP 6 and earlier, it does. In VFP 8 and 9, use DOEVENTS FORCE to get a repaint.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top