FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour please a sample with timer and TRY catch
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
please a sample with timer and TRY catch
Posted: Sat Sep 22, 2018 07: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 (fw): Select all Collapse
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 March-April 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

Continue the discussion