In article <1121298314.366531.125510 (AT) g49g2000cwa (DOT) googlegroups.com>,
"Sug" <adam.sugerman (AT) gmail (DOT) com> wrote:
Quote:
In script steps where I want to set a specific repetition on a
repeating field, is there a way to assign the repetition number by
calculation rather than manually (i.e., non-variably) in the Specify
Field dialog? Right now I use the Set Field step and specify the
repetition of the target field manually, whereas the result field can
be managed via calculation.
I know there were no workarounds (other than logical arguments) in FM6,
but perhaps FM7 has resolved this. If so, I haven't found it. Anyone? |
Although there is a Get Repetition function which allows a field value
to be used to specifiy the repetition, there is no equivalent Set
Repetition command - the one main problem that makes Repeating fields
almost useless and the command that's for some strange reason FileMaker
Inc refuses to put in since they added repeating fields. A lot like
their parent company Apple, some of FileMaker Inc's decisions are just
plain weird.

(
There are some ways around it. The simplest is probably to have your
own Global fields and script.
ie.
RepetitionToSet Global, Number
ValueToSet Global, {whatever type needed}
Script: SetRepetition
If [RepetitionToSet = 1]
Set Field [RepeatField, ValueToSet]
End If
If [RepetitionToSet = 2]
Set Field [RepeatField -2, ValueToSet]
End If
...
If [RepetitionToSet = X]
Set Field [RepeatField -X, ValueToSet]
End If
These can then be easily used from any other script
eg.
Set Field [RepetitionToSet, 5]
Set Field [ValueToSet, "Fred Flintstone"]
Perform Script [SetRepetition]
There is another way which uses the Extend function, but it gets
complicated and the above is much easier to understand and fix.

)
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)