raymanj Posted December 2, 2004 Posted December 2, 2004 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
-Queue- Posted December 2, 2004 Posted December 2, 2004 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.
transpower Posted December 2, 2004 Posted December 2, 2004 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.
raymanj Posted December 2, 2004 Author Posted December 2, 2004 Thanks guys, I had already started with the 28 if statements. I just thought there had to be an easier way.
Recommended Posts
This topic is 7643 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 accountSign in
Already have an account? Sign in here.
Sign In Now