Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7299 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am trying to move through and set a field's repetitions with a loop. can this be done?

I have a list of records. The count can be between 1 and 28. The list of records changes all the time so I never know how many until the the script is ran. I need to copy some text data from the list of records into the global field repetition of [28].

So I created a script to loop through the records and set the field reps, but one problem in the setfield step. I can't set the field rep count to my variable counter. I can only do it manually.

Does anyone know how this can be done in FM 7

counter = 1

goto first record

loop

setfield (data from other record; rep = count)

goto next record (exit on last)

end loop

Posted

You can loop through the repetitions using

Go to Field [repfield]

Loop

Set Field [ ; data]

Go to Next Field

Exit Loop If [Get(ActiveRepetitionNumber) = 1 or Get(ActiveFieldName) <> "repfield"]

End Loop

and not specifying the target for the Set Field step, which will use the field repetition the cursor is in. But you can't do the opposite and loop through the records, setting a dynamic repetition, unfortunately.

Posted

You could have 28 If-Then statements, like If Count = 1 Then Set Field repetition 1, etc. This is very inelegant, though. Take a look at post #132461 which may point the way toward a better solution.

This topic is 7299 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.