Information générale
Catégorie:
Programmation Orientée Object
Versions des environnements
Randy,
Thanks for the answer. I think i will disable the timer just to be sure.
>>In a VFP 8.0 application (.EXE) we have a timer that calls a method in an object. Same method in same (instance of) object can also be called by clicking on a button in a screen. If they would be called exactly at the same time, would that be a problem?
>
>You can get into the same method twice, but you would probably not see this unless you were trying to have this occur. In the situation where the timer "fires" while the method is already running, the timer() event code is going to be deferred until you get to the next wait state, unless your method code issues a DOEVENTS statement. Presumably you would not do that on purpose, buf if you did, the call stack might look like:
>
>- higher calling code
>-- button.click
>--- object.theMethod()
>---- timer.timer()
>----- object.theMethod()
>
>A similar sequence could exist if the timer fired before the button click.
>
>If this is not what you want, and you're concerned that it could occur, you could consider either disabling the timer or setting an object property to flag if the method is already executing, so you avoid the situation.
>
>-- Randy
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement