2 Replies Latest reply on Jul 12, 2012 9:52 AM by bmagargal

    How Can I Resume a Paused (Indefinitely) script using a script?



      How Can I Resume a Paused (Indefinitely) script using a script?


      I am working on a specialized Countdown Time App. The user starts the timer, then after it stops (and plays a sound), the user clicks a button to start the next cycle. This part is easy. However, while waiting for the user to click I have a simple loop that updates the overall elapsed time for the accumulated sessions. I handle this using a "pause timer" flag (see script).

      The problem is the timer loop goes into an indefinite pause after the pause flag is reset (to resume). This happens UNLESS I do one of the following: A) if I use the script debugger everything works fine.  B) I add a 2nd button to "Resume", the script continues. The user shouldn't have to click two different buttons to reset the countdown timer.

      SO, is there a way to Resume an indefinite pause using a script, OR is there a way that I can have a script activate a button whose only purpose is to Resume a paused script?  Perhaps there is a better way to do this whole thing, i.e. a countdown timer plugin or something?


      Thanks for any help you can offer  - Bill


        • 1. Re: How Can I Resume a Paused (Indefinitely) script using a script?

          I don't see any Pause/Resume Script [duration: Indefinitely]

          in this script.

          What I do see, is a loop that will continue to loop until the timer.pause.flag field is set to False, 0 or null.

          I would think that

          Set Field [YourTable::Timer.pause.flag ; False ]
          Commit Records

          would do that without any issues.

          PS. I'd use some global variables here instead of fields if I were to write such a script.

          • 2. Re: How Can I Resume a Paused (Indefinitely) script using a script?

            Phil - thanks for the response. I'll try the Commit Records step, although I don't really have any records open when that script is running.

            All of the fields in this script are globals. I chose to use fields rather than variables for ease of documentation purposes. $$variables tend to get lost in the scripts and one tends to double up on them.

            Regarding the Pause/Resume Script [duration;Indefinitely] script step, you're right. I'm not using one, but that's what happens when I run the script, i.e. it pauses until I click an ad hoc button I added to "Resume Script".

            Thanks again - Bill