5 Replies Latest reply on Aug 4, 2011 12:48 PM by VerneArase

    Script debugs fine but returns errors in real timw

    RickWhitelaw

      Summary

      Script debugs fine but returns errors in real timw

      Description of the issue

      I use a long script to compile a payroll. For some reason it's returning a lot of zeros despite valid input. When I debug it everything works fine. As a matter of fact, when I debug the "parent" script (which does little other than call other scripts), even without entering any sub-scripts, it debugs just fine.I've never encountered this sort of contradiction before. Any ideas? Rick. FM Pro Advanced 10/MacPro quad core 

        • 1. Re: Script debugs fine but returns errors in real timw
          jmfeeney
            

          @Rick

           

          Do you have any privilege sets defined for this database? Performing a script with limited privileges can result in errors that do not occur when debugging with Admin access. Double-check the context. I've encountered privilege set restrictions a number of times and it can be a nuisance to get them sorted.

           

          Are your scripts behaving differently on FMP10A compared to an earlier version?

          • 2. Re: Script debugs fine but returns errors in real timw
            RickWhitelaw
              

            Thanks for the reply. The scripts run with full privileges. There are no other sets defined. Oddly enough, if I run it for a second time, it works! Running it from a backup copy also works.

            Very mysterious.

             

            RW 

            • 3. Re: Script debugs fine but returns errors in real timw
              TSGal

              RickWhitelaw:

               

              Thank you for your post.

               

              It's difficult to determine what may be the problem.  Besides using the Debug mode, try inserting a "Halt Script" script step in a strategic place to make sure fields/variables/etc. are being updated properly when the script is run.  If it isn't, and it does work in Debug mode, then the script may be somehow corrupt.  (I don't know why that would occur).  See if you can determine where the breakdown occurs.

               

              Try creating a new script, or a sub-scripts and call that from the main script.  See if that works correctly.

               

              Sorry I can't be more definite without seeing the script.

               

              TSGal

              FileMaker, Inc. 

              • 4. Re: Script debugs fine but returns errors in real timw
                RickWhitelaw
                  

                Thanks!

                I inserted a .5 second pause after a Commit step and it works fine. This would seem to add 10 seconds to a payroll of twenty people, but in effect doesn't lengthen the entire process at all since the refresh time is now spread out over however many records are being processed. I'll also try it with a shorter pause.

                 

                RW 

                • 5. Re: Script debugs fine but returns errors in real timw
                  VerneArase

                  Do you use a "do script" in your code?

                  If so, you should know that there's been a known bug in v11 for OVER A YEAR where a "do script" returns control to the AppleScript Interpreter BEFORE it's completed. This tends to cause all sorts of problems which may or may not occur due to realtime constraints.