My app not responding sometimes. I am using timer & xbrowse in app.
- Code: Select all Expand view
- DEFINE WINDOW oWnd Title "Messaging system"
DEFINE MSGBAR PROMPT "Msg System" ;
OF oWnd 2007 KEYBOARD DATE TIME
@ 0, 0 XBROWSE oBrw OF oWnd LINES AUTOSORT ;
COLUMNS "MSGFROM","MSG","REPLY","MSGDT" ALIAS "TGMSGS" NOBORDER
OBrw:nRowHeight:=25
oBRW:REPLY:nEditType :=EDIT_GET
oBrw:REPLY:bEditWhen := { || oTimer:Deactivate() }
oBrw:REPLY:bEditValid := { |o| (oTimer:Activate(),Dmsg(TGMSGS->CHATID,o:VarGet()),.t.) }
oBrw:CreateFromCode()
// oBrw:bLDblClick = { || oBrw:EditSource(,, .T.) }
oWnd:oClient = oBrw
Define Timer oTimer Interval 4000 Action UpdateDbf() OF oWnd
Activate Timer oTimer
ACTIVATE WINDOW oWnd MAXIMIZED
oTimer:End()
RETURN NIL
function UpdateDbf()
//local nRec:=TGMsgs->(Recno())
oTimer:Deactivate()
ReadMessages() // Read mesages using http post from telegram and appned to dbf
sysrefresh()
AutoReplyMsg() // reply msgs using http post
sysrefresh()
oTimer:Activate()
oBrw:setfocus()
sysrefresh()
return nil
Regards
Yunus