Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to know code is running when firing timer event
Message
 
To
26/12/2011 02:48:39
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01530700
Message ID:
01531765
Views:
82
Hi Fabio,

Frankly speaking, I don't understand. Can you explain why?

Looking at your code, g_WaitCode is always larger than 0 no matter method code is running or not.

Ben


>>Fabio,
>>
>>After adding the counter, how can I detect if the timer is firing between 2 lines of the method code of a modal form?
>>
>>Ben
>>
>
>* on Timer Event
>IF m.g_WaitCode>0
>            * a VFP line code is running
>ELSE
>           * Stand Alone event
>ENDIF
>
>>
>>
>>>>Fabio
>>>>
>>>>Thanks for your suggestion. However when an modal form is on top, the stack level is higher than 1.
>>>>I want the time code runs no matter a modal form or a modaless form is on top, but not between code lines.
>>>>Will it be possible to do it?
>>>>
>>>>Ben
>>>>
>>>
>>>AFAIK with native VFP behaviour NO.
>>>
>>>You can workaround every middle code waiting with a public counter or _SCREEN.property
>>>and remove the counter from the PROGRAM(-1)
>>>
>>>
>>>g_WaitCode = m.g_WaitCode +1
>>>READ EVENT
>>>g_WaitCode = MAX(m.g_WaitCode -1,0)
>>>
>>>****************************************
>>>g_WaitCode = m.g_WaitCode +1
>>>* create a modal form
>>>g_WaitCode = MAX(m.g_WaitCode -1,0)
>>>
>>>
>>>
>>>Check if the timer event fires between two lines on execution is not a good way.
>>>My real suggestion is to change the way to get to do what you want to do.
>>>
>>>>
>>>>
>>>>>>How can I know if some VFP code is still running when a timer event is fired?
>>>>>>
>>>>>>TIA
>>>>>>Ben
>>>>>
>>>>>vfp uses a common stack,
>>>>>then check stack level
>>>>>
>>>>>IF PROGRAM(-1)>1
>>>>>....
>>>>>
>>>>>
>>>>>If Timer event run at level 2 or more then the event is fired between 2 running lines.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform