Page 1 of 1

dc_setTimerEvent()

Posted: Mon Dec 27, 2010 2:19 pm
by bwolfsohn
Roger,

It looks like DC_SetTimerEvent doesn't run the code block being timed for the first time until AFTER the timer has run the first time.

in this example, optimizepoll() doesn't run the first time until 60 seconds have elapsed. I thought the xbase settimerevent() ran the code clock first, then kicked the timer in. (i could certainly be wrong.. (AGAIN!!))


DCREAD GUI ;
FIT ;
TITLE "Monitoring Incoming Pictures" ;
MODAL ;
OPTIONS GetOptions ;
EVAL {|o|oTimer:=DC_SetTimerEvent():new(60* 100,;
{||guirun({||OptimizePoll(getlist,cAuction,lCreateDetail,lCreateThumbs,alltrim(cMonitorDirectory),alltrim(cDirectory)) })} )}

Re: dc_setTimerEvent()

Posted: Mon Dec 27, 2010 2:30 pm
by rdonnay
Brian -

You are right! This should fix it:

In _DCFUNCT.PRG change METHOD DC_SetTimerEvent:TimerLoop() as shown below.
Then rebuild DCLIPX.DLL by running BUILD19_SL1.bat or BUILD19.bat. This fix will be in build 255.
Let me know if you want me to send you a compiled DCLIPX.DLL.

Code: Select all

METHOD DC_SetTimerEvent:TimerLoop()

LOCAL nCount := -1, nSleep

DO WHILE ::interval > 0
  IF nCount >= ::interval .OR. nCount == -1
    Eval(::evalBlock)
    nCount := 0
  ENDIF
  IF ::interval < 100
    nSleep := ::interval
  ELSE
    nSleep := 100
  ENDIF
  Sleep(nSleep)
  nCount += nSleep
ENDDO

RETURN nil

Re: dc_setTimerEvent()

Posted: Mon Dec 27, 2010 2:47 pm
by bwolfsohn
rdonnay wrote:Let me know if you want me to send you a compiled DCLIPX.DLL.
Roger, a compiled dclipx would be wonderful..
What is your planned timing on a 255 release ??