2 Replies Latest reply on Oct 11, 2011 3:22 PM by TSGal

    Set Field Repetition calculation is evaluated multiple times

    nickorr

      Summary

      Set Field Repetition calculation is evaluated multiple times

      Product

      FileMaker Pro

      Version

      110v3

      Operating system version

      Mac OS 10.7.1

      Description of the issue

      When you are using a calculation in the repetition area of a Set Field script step, the calculation is evaluated more than once.

      Steps to reproduce the problem

      Create a new file with one field with some repetitions.

      Create a script with a Set Field step, setting the field created above.

      Put the following calculation into the "Repetition:" calculation box : 

      Let ( $$var = $$var & "1" ; $$var )

      Set a value for the result as well. Perform the script and check the value of $$var after the script runs.

      Expected result

      $$var should be "1".  The calculation should be evaluated once and it should only have a single character in it for each time the script is run.

      Actual result

      In my sample file with 10 repetitions I had the value "111".  But I've seen the values repeat in a real world example with hundreds of values.

      The big issue with this is if it's a complex calc it might be causing large slowdowns to evaluate this calc many times.

      Exact text of any error message(s) that appear

      None

      Configuration information

      NA

      Workaround

      In the specific case I've got, I can set the variable in the step beforehand.  But in some cases this might not be applicable.

      I have a sample file as well if required.

        • 1. Re: Set Field Repetition calculation is evaluated multiple times
          nickorr

          Just a followup to this.  It's an artifact of the debugger, not something that happens every time.  In my simplified example above, I get three characters with the debugger open.  With it closed I only get one.

           

          Something in the debugger is evaluating this calc ( but not others ) just on opening the debugger window.

          • 2. Re: Set Field Repetition calculation is evaluated multiple times
            TSGal

            Nicholas Orr:

            Thank you for your post.

            This problem has been reported previously.  From the notes, it appears a buffer overrun occurs when repeating a script debug several times on a Let function where a local variable is used alongside a global variable (in your case, two global variables) with both Script Debugger and Data Viewer opened.

            I have attached your post to the original case.  When there is an update, I will let you know.

            TSGal
            FileMaker, Inc.