Object.KillTimer Event Not Working
from
WinCustomize Forums
I am using DesktopX 1.99c[b] and I don't believe that the Object.KillTimer event works in VBScript. I have created a test program. In the program, if the coding works as I think it does, when you click on the object,the timer is set, a message box should pop up when the timer goes off, and then the timer should be killed. Instead I am finding that th emessage boxes keep appearing and appearing until you disable the script on the object. Here is the code I am using to test it:
----------------
'Called when the script is executed
Sub Object_OnScriptEnter
TimerExecuted=0
End Sub
'Called when the script is terminated
Sub Object_OnScriptExit
End Sub
'Called when the object state is changed
Sub Object_OnStateChange(State)
If Object.State = "Command executed" Then
Object.SetTimer 1, 5.6
End If
End Sub
Sub Object_OnTimer1
Script.MsgBox "This should only display once if Timer 1 is being killed."
Object.KillTimer1
End Sub
----------------
Unless my coding is flawed (which is very possible) it appears that the KillTimer even is not working. Why is it not working? Thanks!!
----------------
'Called when the script is executed
Sub Object_OnScriptEnter
TimerExecuted=0
End Sub
'Called when the script is terminated
Sub Object_OnScriptExit
End Sub
'Called when the object state is changed
Sub Object_OnStateChange(State)
If Object.State = "Command executed" Then
Object.SetTimer 1, 5.6
End If
End Sub
Sub Object_OnTimer1
Script.MsgBox "This should only display once if Timer 1 is being killed."
Object.KillTimer1
End Sub
----------------
Unless my coding is flawed (which is very possible) it appears that the KillTimer even is not working. Why is it not working? Thanks!!
Could someone else please test the above posted code? It would be very much appreciated. Thanks!