4 Replies Latest reply on Aug 19, 2009 8:34 PM by mrvodka

    Install OnTimer Script problems



      Install OnTimer Script problems


      I have a couple different layouts with the same field on both where I've got a timer set up using the "Install OnTimer Script".  I've noticed two problems that seem to have developed today...


      1. The timer is not smooth...it will count evenly, then slow down, then speed up, and so on. 


      2.  The timer field on one layout flashes and is really slow (I've noticed this when using this command within a portal, but not a normal field), and the timer field on another layout does not flash and counts more regularly, but still has problem 1.


      I like the Install OnTimer Script because I need it to increment every .1 seconds and still need to do other things while the timer is counting.


      Has anyone else had these issues? 


      Any suggestions?



        • 1. Re: Install OnTimer Script problems
             I was able to correct problem #2, but still can't get #1.
          • 2. Re: Install OnTimer Script problems

            I dont believe that the timer was meant to be used as such.


            FileMaker's script engine is single threaded. Called scripts sit in a stack. Therefore, if you have another script that is called and put in the stack, FileMaker will have to wait until the script is fully completed to run the next script. So although you have a script that runs every .1 sec, most likely it is not realyl running every .1 seconds. 


            It is not a true clock like timer, nor should it be used as such.


            • 3. Re: Install OnTimer Script problems

              Do you know of a better way to create a timer that can run every .1 seconds that does not have to loop, as looping will tie up any other functions that need to happen?


              When we were looking at upgrading to FM Pro 10 Advanced, we had called FM with this question, and we were told at that point that the Install OnTimer Script would be the way to do it, but I am open to a better way if anyone knows of one.



              • 4. Re: Install OnTimer Script problems

                I think that you may need to rethink your strategy here. Can you go into further detail of what you are trying to achieve and the purpose here?


                Another option may be to run the process on another machine acting as a robot.