by Jack » Sun Dec 20, 2009 9:59 am
I have the same question and solved it this way :
EACH TIME I ENTER IN A MENU,A BROWSE , A DIALOG , I CALL the CheckT procedure with 1 as parameteers, it reset the counter to 1 CheckT(1)
DEFINE WINDOW oWnd FROM 0,0 TO 29,78
MENU BuildMenu()
SET MESSAGE OF oWnd ;
TO "Timer ;
CENTERED DATE KEYBOARD
DEFINE TIMER oTmr INTERVAL 10000 ACTION CheckT() OF oWnd
ACTIVATE TIMER oTmr
ACTIVATE WINDOW oWnd MAXIMIZED
*
* ===
procedure CheckT(pr)
LOCAL hWnd,wjacfo,vdxx
static cteur:=1
if pr=NIL
cteur:=cteur+1
oWnd:SetMsg("Value TimeOut :"+str(cteur,10)+" ")
else
cteur:=pr && reset
endif
*
if cteur > 300 && This will stop the application
cteur:=1
oTmr:end()
close databases
set resources to
cteur:=1
*
oWnd:end()
quit
endif
*
RETURN