PDA

View Full Version : Timer with a variable as the length



Mastiff
October 24th, 2004, 12:43 PM
I have a slight hiccup here in my playlist selecter. In my init script I want to set the timers for the different zones (my daughter may need a bit more time to press the buttons than my son - even though she's very fast at pushing his angry button, but I digress...), and I tried with this in the init script:

Z0Delay = "3000" --sets the delay in milliseconds for zone 0

And then this in the actual timer:

Z0Timer = TIMER_CreateObject()
Z0Timer.Create("", "TriggerEvent('Z0.Execute',18)", "", 0)
Z0Timer.Arm("Z0Delay")

But the timer doesn't work. I have checked, and the variable is set correctly within Girder, but removing the variable in the Timer.Arm line and putting in the actual millisecond value makes the timer work again. There has to be a small miss there, but what?

Edit: Silly me. I shouldn't use "" around variables! Sorry... :oops:

Promixis
October 24th, 2004, 12:51 PM
Remove the quotes around your time name when arming!!

Mastiff
October 24th, 2004, 12:55 PM
Dang, I thought I found it soon enough to stop you with that edit... Anyway, thanks for being quick on the trigger! Maybe next time I can ask you an intelligent question...but don't hold your breath! :wink: