5 Replies Latest reply on Aug 30, 2012 10:39 AM by philmodjunk

    Repeating Variable Issue



      Repeating Variable Issue


      I dont use repeating fields anymore, but just tried my first repeating variable in a solution but am having an issue.

      i can see in the data viewer that the repetition value for a variable is correct, but when i go to retrieve that value, it is always the first repetition value.

      i did this test to prove this simple point, see attached.

      i made a variable and a global repeating field to both hold the same value as each other.

      i retrieve data from both and the global field shows correct value, but the variable does not.


        • 1. Re: Repeating Variable Issue

          Your script does not include the repetition number, so it default to 1.   See the following example

          Set Variable [$$bonus[2]; Value:3 * 4]

          [2] is the repetition number

          retpetition number is the position in the variable.

          • 2. Re: Repeating Variable Issue

            I get an error message in the data viewer in FileMaker Advanced when I try to use GetRepetition with a variable instead of a field in FMP12. I don't think you can use a repeating variable in place of a repeating field in that function. The other syntax that you are already using to reference a repetition of the variable works just fine though. Use:

            $variableTest [4] in place of GetRepetition($variableTest ; 4 )

            • 3. Re: Repeating Variable Issue

              Sure it does, $cntr is my next repetition number

              if you look at the screen shot, you will see that $VariableTest has 10 repetitions all w/ different values.

              but when you display the results for both the variable and the global field, variable one is only value from 1st repetition.

              • 4. Re: Repeating Variable Issue

                Phil,  what you suggested does work

                instead of getrepetition i use $variable [x] it works great.

                very odd...


                "Repeating Field Value: " & $VariableTest [4] & "¶" &
                "Global Field Value: " & GetRepetition ( Test::FieldName ; 4 )

                • 5. Re: Repeating Variable Issue

                  It's consistent with the info in the help file on getRepetition. There's no mention of being able to substitute a repeating variable for a repeating field. Doeing so would see logical and the help file doesn't say you can't do that, it just doesn't mention variables at all--probably because the function and this help entry were both created many years before variables became a FileMaker Feature.