Can anyone tell me how to create a page that will jump to another page after 10 minutes?
Thanks
Professional Software Development Tools
Can anyone tell me how to create a page that will jump to another page after 10 minutes?
Thanks
I like the easy ones
Just put this in the first pages onShow Event -
Page.StartTimer(600000);
Then, in the onTimer event, tell it what to do when the timer fires -
Page.Jump("your_page");
HTH
Here is a little trick I learned from Worm. It uses a dll on your windows machine to get the system time. It proved to be more accurate when creating a timer for the quiz app that I built.
I have tried to add comments on things you can change within the project. Let me know if you have questions.
Here is the function:
DoTimer(allowedtime, JumpPage);
- allowedtime is defined in seconds unless you uncomment a line within the function, then you can define allowedtime in minutes
- JumpPage is a string that defines the page to which you want to jump
TiggCode:function DoTimer(allowedtime, JumpPage) -- allowedtime is defined in Seconds -- JumpPage is a string defining the page to jump to when the timer expires -- Uncomment the following text to change the specified allowed time from seconds to minutes --allowedtime = allowedtime *60 if basetime == nil then basetime = DLL.CallFunction(_SystemFolder .. "\\winmm.dll", "timeGetTime", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL) end curtime = DLL.CallFunction(_SystemFolder .. "\\winmm.dll", "timeGetTime", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL) elapsedtime = allowedtime - ((String.ToNumber(curtime) - String.ToNumber(basetime)) / 1000) if elapsedtime <= 0 then Page.StopTimer() Page.Jump(JumpPage) else --comment out or delete this section to remove the timer that is shown on the page hours = Math.Floor(elapsedtime / 3600); mins = Math.Floor((elapsedtime - (hours * 3600)) / 60); secs = Math.Floor(elapsedtime - ((hours*3600)+(mins*60))); if hours < 10 then hours = "0"..hours; end if mins < 10 then mins = "0"..mins; end if secs < 10 then secs = "0"..secs; end Label.SetText("Timer", hours..":"..mins..":"..secs) --delete or comment through here end end
TJ-Tigger
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
"Draco dormiens nunquam titillandus."
Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine