Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The Timer Control
Message
 
To
20/03/2007 11:10:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01206038
Message ID:
01206114
Views:
19
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform