June 13, 200223 yr That was quite a drag. Browsing the forum I was warned against using repeating fields, and I avoid them, but I have a situation in which the use of repeating fields is the best solution. I have a database in which each records contains 12 months, each month filled with identical data, received amount, date of payment etc. All these fields are not repetition fields. They are named amount01, amount02 etc. I needed a way to make the user choose from different proposition sets (3) for the proposition_amounts to pre-fill the database in an easy way. To make 3x12 different fields for that option was overkill; so I used repeated fields for that. And for some reasons these repeated fields should be entered automatically, by a script. (That's because I let the user swap the different columns contents, another story) This is the point where I wonder why the opposite of GetRepetion (PUTRepetition) is not implemented. Would make RepetitionFieldlife much easier.. Anyhow, I found a way to do it. In the following example a repetition field with 12 repetitions is copied into another. There are two conditions to be met: 1) the destination repetition field must be on a layout, and 2) it must be tab-ordered incremented by one, starting from the first repetition field. #
June 13, 200223 yr No insert calc value cannot be substituted with set field (since you would have to specify the repeatiton) Instead try Insert Calculated Result [ GetRepetition(source_rep_field;g_counter) & ""] Dj
June 13, 200223 yr Author >Instead try >Insert Calculated Result [ GetRepetition(source_rep_field;g_counter) & ""] Nope, I tried this again in a copy of the script, using GetRepetition this way does not work, when using an in-between global the way I did, it does work. I don't know why that is. I also tried your add & "". You must have your reasons to add this.. Anyhow, it works.. Harry
June 14, 200223 yr Try this script: SetField["RepField2", "RepField1"] SetField["RepField2"-2, "RepField1"] SetField["RepField2"-3, "RepField1"] ... etc. however many repetitions you need to fill ...and the fields do not have to be on the layout.
Create an account or sign in to comment