Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timer events
Message
De
22/11/2001 01:03:29
 
 
À
22/11/2001 01:01:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Divers
Thread ID:
00584801
Message ID:
00584813
Vues:
23
>>How do I stop the timer firing while in a timer event?
>>Lets say I have a timer, tim1, on a form.
>>If the first line of the tim1.timer() event is
>>this.enabled= .F.
>>shouldn't that stop the timer firing again.
>
>Yes. According to the docs for the VFP7 .Enabled property:
>
>Disabling a Timer control by setting Enabled to false (.F.) cancels the countdown specified by the Timer control's Interval property.
>
>>Yet if I debug and step through the code, the timer keeps firing.
>>If I put
>>this.interval= 0
>>in the first line the debugger stops and looses its place.
>>I'm sure I used to be able to do this somehow??
>
>Have you tried a really basic test, like maybe using a WAIT WINDOW, not in the debugger? Is there anything else unusual in the environment like an ActiveX?
>
>>Also, if my timer() code takes 2 seconds to run and the interval is set to 500 milliseconds, the timer seems to re-fire whilst in the middle of the code execution. Should that be?
>
>Certainly. That's why you need to disable it while its event is running.

But I have .enabled set to .F. and it still seems to fire. I think I need a lot more evaluation of this. Something is fishy!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform