3 Replies Latest reply on May 8, 2013 3:06 PM by philmodjunk

    interval timer



      interval timer



           I am very new to FM and am trying to design a tool to gather tally information and a timer for interval recording. I have ongoing timers set up to indicate when the activities start and stop. Ideally, when the "activity start" button is triggered, I would like a window (if possible) to pop up every 20 seconds so a # can be entered, then have it go away until 20 more seconds have passed until the "stop" button is pressed. Can anyone help with this? It looks like the onTimer will do this, but I am not clear on how to set it up.

           ALSO I will be using this with FM GO...does this change the capabilities?

           Thanks in advance!!

        • 1. Re: interval timer

               Install OnTimer is the method that can be used to do this.

               Install OnTimer Script is a script step you can include in a script to start your "timer". You then create a second script that uses show custom dialog to open your dialog for collecting the number and set the Install OnTimer Script step to perform this script.

               You then use a third script with Install OnTimer Script but no parameters specified to halt the timer when you are done.

          • 2. Re: interval timer

                 WOW! this is exciting news....thank you PhilModJunk.

                 Would you mind walking me through the steps?

            • 3. Re: interval timer

                   Create script named "Record Data"

                   SHow Custom Dialog ["Please enter a value" ] ---> specify a global for recording the data.
                   If [Get (LastMessageChoice) = 1 //OK was clicked ]
                      New Record/Request
                      Set Field [YourTable::YourDataField ; YourTable::GlobalFIeld]
                      Set Field [YOurTable::GLobalField ; ""]
                   End IF

                   Create a second script to perform the first every 20 seconds:

                   Install ONTimer Script ["Record Data" ; interval: 20 ]

                   Create a third script with just this step:

                   Install ONTimer Script []

                   and perform it to halt the timer.