dc_setTimerEvent()

This forum is for eXpress++ general support.
Post Reply
Message
Author
bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

dc_setTimerEvent()

#1 Post 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)) })} )}
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_setTimerEvent()

#2 Post 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
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: dc_setTimerEvent()

#3 Post 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 ??
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

Post Reply