Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Timer Control
Message
 
À
20/03/2007 11:10:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01206038
Message ID:
01206114
Vues:
18
>>Hi FoxGang!
>>
>>Question... concerning the Timer control, after the Timer Event fires, does the countdown to the next event firing start immediately, or does it wait to start counting down AFTER the Event has finished it's code?
>>
>>Thanks!
>
>Tommy,
>
>1) If you just want to make sure the next timer event fires only after the timer interval time then issue a timer.enabled = .f. when starting your timer code, then a timer.reset and timer.enabled = .t. at the end of your timer event.
>
>2) If you need to fire code at specific intervals then create a custom timer with an additional property to hold a datetime value. Set the timer to fire every 1 second (assuming 1 second intervals is sufficient for your purposes). Then in the timer event check whether the current datetime() value is the correct number of seconds / minutes / hours since the datetime value stored in the custom datetime property. If so then execute your code and update the datetime property to reflect the last datetime that the code was executed.

Sounds good.

Thanks
Tommy Tillman A+ NetWork+ MCP
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform