0

Multiple roTimers



I have a new application that requires multiple timers.
Is there a way to identify which timer triggered the event when using a wait

1 bbcodeparser bbcode.php bbcode.pl bbcode.txt bbparse.php engine existusers.txt extstusers.parsed1.txt extstusers.parsed2.txt extstusers.parsed.txt htmlentdec.php logs nbbc_files phpbb2zendesk.log phpbb3-to-zd.log phpbb3-to-zdnew.log phpbb3-to-zd.sh phpbb3-to-zd-undo.sh phpbb_db phpbbdb3 phpbbusers.xls postids.tmp post_results.xml posts.xml SBBCodeParser.php stdout studioloft_phpbb.sql styles test2 test4 tests testtext.txt test.txt txt2html_func.php txt2html.php txthtmlencode.php users.json users.json.txt users_tmp.json users_tmp_nc.json zddelete zdget zdpost
timer1=CreateObject("roTimer")
timer2=CreateObject("roTimer")
p=CreateObject("roMessagePort")

timer1.SetPort(p)
timer2.SetPort(p)

timer1.SetDate(-1, -1, -1)
timer1.SetTime(StartHour, StartMinute, 0, 0)
timer1.Start()

timer2.SetDate(-1, -1, -1)
timer2.SetTime(StopHour, StopMinute, 0, 0)
timer2.Start()

Wait_for_Event:
msg = wait(0,p)
if (type(msg) = "roTimerEvent") then

"Here I need to know which timer triggered the event"

3 comments

  • 0
    Avatar
    RokuLyndon


    You can make the following comparison:



    if msg.GetSourceIdentity() = timer1.GetIdentity() then







    else if  if msg.GetSourceIdentity() = timer2.GetIdentity() then







    endif
  • 0
    Avatar
    Brian2


    Wonderful...thanks
  • 0
    Avatar
    acalleja

    Another way is to do something like:

     

    timer1.SetUserData(1)

    timer2.SetUserData(2)

     

    [...]

    if (type(msg) = "roTimerEvent") then

    if msg.GetUserData() = 1 then

    [...]

    if msg.GetUserData() = 2 then

    [...]

     

     

     

     

Please sign in to leave a comment.