>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
>
IF m.g_WaitCode>0
ELSE
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.