[futurebasic] Re: [FB] [FB^3] Timer Blink

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 1999 : Group Archive : Group : All Groups

From: Rick Brown <rbrown@...>
Date: Sun, 19 Sep 1999 10:49:17 -0500

Ken Shmidheiser wrote:

> Note:
> You can use the TIMER statement to change the timing interval.  You
> cannot disable timer events once they've been initiated.
>
> My question is: If I can't disable timer events once they's been
> initiated, how can I stop the blink? I've tried to create a LONG IF
> in the main loop calling ON TIMER when the main window is open, and
> not when the About window is open, but that doesn't work.
>
> Any ideas how to get rid of the blink?

In this particular case, I would suggest just commenting-out the "FN
aboutwindow" statement in FN doTimer, like so:

LOCAL FN doTimer
  LONG IF WINDOW(_activeWnd) = 2
    t$=TIME$
    t$=LEFT$(t$,8)
    EDIT$(3) = t$
  XELSE
    'FN aboutWindow
  END IF
END FN

That statement is unnecessary because the "about" window is already active;
all this statement does is "re-activate" it every 2 seconds, and that's what's
causing the blink.

In the more general case, the usual remedy is to define some global variable
like "gTimerOff", which you can set to _zTrue when you want to de-activate the
TIMER logic.  Then your FN doTimer would look like this:

LOCAL FN doTimer
  LONG IF gTimerOff = _false
    LONG IF WINDOW(_activeWnd) = 2
      t$=TIME$
      t$=LEFT$(t$,8)
      EDIT$(3) = t$
    XELSE
      FN aboutWindow
    END IF
  END IF
END FN

- Rick