Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What could make Timer to stop?
Message
De
06/03/2009 08:29:50
 
 
À
05/03/2009 13:00:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01385495
Message ID:
01386131
Vues:
47
>>>>>>I have a small program with two timers; one timer is simply used to show the progressing of times (in seconds). The second timer actually performs a procedure every minute. It happened once last week and today that customer reports that the timer that shows progressing of time stops at various points (e.g. 43 seconds) and the program stops. It does not freeze though as he is able to click on the Stop button and restart the program.
>>>>>>
>>>>>>What could possibly cause the timer to stop?
>>>>>
>>>>>A tight loop that doesn't give the timer any chance to act. Make sure that any such loops in your code include DOEVENTS to allow the timer to fire.
>>>>>
>>>>>Tamar
>>>>
>>>>What do you mean by "tight loop"? Is it DO WHILE that runs through many records in the timer event?
>>>
>>>Any kind of loop that has processing code and no wait states.
>>>
>>>Tamar
>>
>>Let me clarify. Say I have a following pseudo loop in a timer event:
>>
>>
>>do while <Some Condition>
>>
>>    DOEVENTS
>>
>>    <SQL Select statement >
>>
>>   <Call to Print a short Report>
>>
>>enddo
>>
>>
>>Putting this DOEVENT in the place where I put it above would be advisable?
>>
>
>Yes, exactly. As Dragan points out, it lets the system "catch its breath" and check whether anything else has happened in the interim.

Exactly? As to my understanding it's not only true for 'tight loops' in a timer event. It's also true in other events.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform