Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #2131

Re: Monitoring a DBF

From "Willie Moore" <williem@wmconsulting.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Monitoring a DBF
Date 2011-10-03 08:12 -0500
Organization Aioe.org NNTP Server
Message-ID <j6ccbl$4v8$1@speranza.aioe.org> (permalink)
References <22fiq.2241$S22.1137@newsfe13.ams2> <ftfiq.1305$KQ5.636@newsfe04.ams2>

Show all headers | View raw


Martin,

I have used timers to handle things like this. The code below is the 
framework I used for my batch monitoring job. The main window was a modeless 
dialog window. In it's postint you would start the timer. I hope that this 
helps.

Regards,
Willie

METHOD Dispatch(oE) CLASS gr8MO

    IF oE:Message == WM_TIMER
        // If we get a timer message, call our timer event
        SELF:runproc()
    ELSEIF oE:Message == WM_DESTROY
        // If a timer is still active
        IF SELF:nTimerHandle > 0
            // Kill it
            KillTimer(SELF:handle(),1)
        ENDIF
    ENDIF
    // Now continue with deafult processing
    RETURN SUPER:dispatch(oE)

METHOD StartTimer() AS VOID PASCAL CLASS gr8MO
      // If there is no timer active
    IF SELF:nTimerHandle == 0
          // Create a new times
          SELF:nTimerHandle := 
SetTimer(SELF:handle(),1,DWORD(SELF:nTimeOut),NULL_PTR)
          // Call the timer Method
          SELF:timer()
          SELF:lTimerInit    := TRUE
    ENDIF
    RETURN

METHOD StopTimer() AS VOID PASCAL CLASS GR8MO
    // If a timer is active
    IF SELF:nTimerHandle > 0
        // Kill the timer
        KillTimer(SELF:handle(),1)
        // Reset the timer handle
        SELF:nTimerHandle := 0
        SELF:lTimerInit    := FALSE
    ENDIF
    RETURN

METHOD RunProc() AS VOID PASCAL CLASS GR8MO
    LOCAL oError        AS USUAL
    LOCAL bErrBlock     AS CODEBLOCK
    LOCAL cReturnText    AS STRING
    LOCAL lLeave        AS LOGIC
    LOCAL nNewMemCount    AS LONG
    LOCAL hResult        AS LONG

    bErrBlock := ErrorBlock({|oErr| _Break(oErr)})
    BEGIN SEQUENCE
        lLeave := FALSE
        SELF:StopTimer()

// put your code here


    RECOVER USING oError
        // your error handling goes here
    END SEQUENCE
    ErrorBlock(bErrBlock)

     SELF:StartTimer()         // go back to sleep till we are needed again

    RETURN


Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Monitoring a DBF Martin <spam@spam.spam> - 2011-10-03 10:14 +0100
  Re: Monitoring a DBF Martin <spam@spam.spam> - 2011-10-03 10:43 +0100
    Re: Monitoring a DBF "Willie Moore" <williem@wmconsulting.com> - 2011-10-03 08:12 -0500
  Re: Monitoring a DBF "Stephen Quinn" <stevejqNO@bigpondSPAM.net.au> - 2011-10-03 20:50 +1100
    Re: Monitoring a DBF Martin <spam@spam.spam> - 2011-10-03 15:28 +0100
  Re: Monitoring a DBF Mathias <mathias.hakansson@consultec.se> - 2011-10-03 02:57 -0700
    Re: Monitoring a DBF Martin <spam@spam.spam> - 2011-10-03 15:28 +0100

csiph-web