No announcement yet.

Events Postpone question.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Events Postpone question.

    So as I mentioned in this thread, when using a timer event across multiple sub programs that are called by file_run() or file_Exec(), sys_EventsPostpone() should be called before exiting each sub program, then the sys_SetTimerEvent() function needs to be recalled at the beginning of each sub function to reset the timer to execute the function in the proper scope. What I'm wondering now is, while events are postponed, they are still queuing up. Will those queued events still try to access out of scope functions after I call the set timer event and events resume functions in my new sub program? How exactly does the event queuing work and is there a way to flush the queue?

    Ok, So Instead of using sys_EventsPostpone() at the end of each sub program, I'm calling a function that sets a global variable and then sets all timers to 0. In each timer function now I check the global variable and if it's set I do nothing and don't reset the timer value. Then at the beginning of each sub program when I set the timer events and values, I clear the global variable. This functions like EventsPostpone and Resume but events aren't queued while the timers are stopped. This seems like a lot of trouble and overhead to be able to use timer functions with file_Run() though.