On Sep 19, 2006, at 1:17 PM, Phil M wrote:
On Sep 19, 2006, at 12:38 PM, Eric Williams wrote:
I've got a timer in a window. Neither the timer nor the window are
subclassed from anything else. The timer has a period of 10,000
(10 seconds), and it fires twice in quick succession every 10
seconds.
Thinking that it might be a problem with that particular timer, I
dragged a completely fresh timer into the window. I put a MsgBox
command in the Action event and set it to 1 seconds, Mode=2 to go
off every seconds. And sure enough, every second, I got two MsgBox's.
Don't use a MsgBox since that is a low-level command and can
interrupt portions of your code. Instead you should send
notification to System.DebugLog to view on OS X Console, or to a
Log window within your own app.
I am not saying that your timer is not firing twice (it very well
could be), but using a MsgBox like this could mess up your test.
Do you think that you might have two copies of the timer running,
or possibly two copies of the Window?
Funny. I just tried this in 5.5.5. A MsgBox in a timer's Action
event. It fired only once after the ten second period. In a one
second period, it fired almost immediately on a continuous basis. In
a five second period it seemed pretty regular if I clicked on OK
immediately.
It almost appears that, if I wait close to or longer than the period
before responding to the message box, it immediately appears again.
If I wait three time the period, it still appears to respond twice.
As Phil states, a message box is not an accurate way to test many
events as it can result in spurious action. It is a Modal Dialog type
of window that doesn't suspend the timer from counting but does
affect its response.
Another thing to remember is that a Timer waits for all other
processes to complete. In this test the actual periods are very
different between various clicks of OK.
Terry
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>