please a sample with timer and TRY catch

please a sample with timer and TRY catch

Postby Silvio.Falconi » Sat Sep 22, 2018 7:52 pm

I have a timer

DEFINE TIMER oTimer INTERVAL 500 OF oWnd ;
ACTION ( nTime++, if ( nTime == 4, UpdateSendReceive(), ))
ACTIVATE TIMER oTimer

on UpdateSendReceive() must call some function but it not run well
Code: Select all  Expand view
function UpdateSendReceive()
local nReC
if ! lWorking
   //nReC:=TGMSGS->(recno())
   sysrefresh()
TRY
   if isinternet()
      if oTimer:nInterval=5000
         oTimer:nInterval=1500
         ntime:=0
      endif
      lWorking = .T.
      ReadMessage()
      sysrefresh()
    *  replymsgAdmin()
    *  sysrefresh()
      ReplyMsg()
      sysrefresh()
   else
    if oTimer:nInterval#5000
       oTimer:nInterval=5000
       ntime:=0
    endif
 endif

  SELECT MS
       MS->(OrdSetFocus(1))   //TAG "UpdtId"
       MS->(DbGoTop())

   oBrw:setfocus()
   obrw:Refresh()

   lWorking = .F.

CATCH oError
   oErr:=.t.
end
endif
sysrefresh()

return nil
 


I wish on each 1500 second it call UpdateSendReceive()
How i resolve ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7057
Joined: Thu Oct 18, 2012 7:17 pm

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 114 guests