Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timed events
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Divers
Thread ID:
00975807
Message ID:
00975903
Vues:
23
Joe,

Just how precise do you need these events to fire? I see you talking about atomic clocks and you are relying on a VFP timer? You might be in for a few suprises. Because VFP timers can be prevented from firing by lots of things. But assuming that a VFP timer is good enough:

If you need these events to trigger within 1 second of the scheduled time then you need to have your timer triggering at at least 2 times that speed, ie the timer interval needs to be 500 milliseconds. If you need an accuracy of 10 seconds the timer interval should be 5000 milliseconds.

Next you should create an event queue, where the time is put in as some future time, when the timer fires you look to see if the current time is greater than any of the events in the queue and if it is then you fire off your handler and remove the event from the queue.
select * ;
   from eventqueue ;
   into cursor todonow ;
   where tWhen < datetime()

if ( _tally > 0 )
   * there is stuff to be done now
   * you either delete the row in eventqueue or if it's a reoccuring event
   * reschedule it for sometime in the future
   replace tWhen with tWhen + 6 * 3600 in eventqueue && reschedule to run in another 6 hours
endif
>>>This sound inaccurate. Seems like it could wander using this method. That's why I figured if every 10 seconds I could look and see if my machine time (atomic time) was 05:59 I would play the wav. Your method leaves me at the mercy of the internal clock tick correct?
>
>So how do I keep it from firing every 10 seconds during 05:59 till 06:00?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform