For the first repetition you need not use the brackets.
Is field1 defined as numeric?
Actually upon looking at it, I figured out that macro portion was fine, my issues are elsewhere.
If I have a repeating Field that looks like this:
I have been using the LIST command to turn that into:
I then set a field to that value, But that puts all those values into the first rep of the field, it doesn't put each value into the first available rep of that field. I don't see an easy way of turning a field with repeating values into the same field just eliminating all the empty reps.
1) Evaluate CODE(Field1) in DataViewer, what does it report ?
2) We don't know what comes after the End IF.
3) It's ok to use  even if omitting it is legit, makes all coherent
4) curly brackets are really sexy.
You could try:
if [getasnumber(Field) ≠ 0]
Set Field[Field ; 99]
if aList is your list, try defining your repeating field as
l = Get ( CalculationRepetitionNumber ) ;
l1 = Extend(aList) ];
Good afternoon andrewma,
I hope your day is going well. Take a look at this sample file, it may give you an idea of how you can remove the empty values from your repeating field. There are two scripts: one populates the repeating field values, and the other reorders them. I used two fields so that you could see the difference, but in your case you may want to reference the same field in the loop as you do in the list() step. Hope this helps. Good luck.
Test.fmp12.zip 66.2 K