Jump to content

Using Set field with repeating fields.


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

Recommended Posts

I have one field that has three repetition. I want to set repetition 3 with repetition 2 and the repetition 2 with 1.

Set Field ["field"-3. "GenRepetition,(field,2)"]

Set Field ["field"-2. "field"]

In my tests it will not work in 5.5 OS X or 9.x. Insert calculated result does not work either. Is this a bug???

Help. confused.gif

Link to comment
Share on other sites

Yes, this might be some kind of bug, or at least for some reason FM does not do. The direct reference in a setfield to a getrepetition does NOT work when a repeated field must be set. But a workaround is to capture the getrepetion in a global, and then do the setfield. It's one step extra but it works.

(I encountered the same too).

Set Field [gTemporaryfield "GetRepetition,(field,2)"]

Set Field ["field"-3. "gTemporaryfield"]

Set Field ["field"-2. "field"]

Harryk

Link to comment
Share on other sites

Hi Harry,

The method you're suggesting is in fact the work-around that FMI recommend in their Kbase article on this subject. But there is a better way.

A little while back the inimitable dj pointed out that you can use:

Set Field ["YourRepeatingField"-3, "GetRepetition(YourRepeatingField, 2) & "" "]

The little appended 'null' on the end apparently has the mysterious effect of distracting FM for just long enough for it to 'forget' that it has a bug with repetitions. wink.gifgrin.gif

Try it out - it works!!

It's still a workaround, maybe, but it sure beats decanting your data all around the place between globals and back (not to mention making the scripts easier to read and a *lot* shorter! smile.gif

Link to comment
Share on other sites

Hi Harry,

I could be 'funny' and say "I don't know"... wink.gif

But seriously, I appreciate the compliment, but knowledge is an ocean, and the human mind is a leaky cup. We're all learning, yet there's always much much more to know! smile.gif

Link to comment
Share on other sites

  • 2 months later...

Poster: CobaltSky

Subject: Re: Using Set field with repeating fields.

Hi Harry,

The method you're suggesting is in fact the work-around that FMI recommend in their Kbase article on this subject. But there is a better way.

A little while back the inimitable dj pointed out that you can use:

Set Field ["YourRepeatingField"-3, "GetRepetition(YourRepeatingField, 2) & "" "]

It's a while back, that you gave me this answer Ray, I remembered it, and the occasion occurred to try it out, but with me, this does not work..

A brief summary of the problem: a setfield of a repeating field with another repeating field does not work, despite the add of the & "".

Of course there are workarounds (apart from the fact that I will tackle my problem another way, with portals), you can use a temporarily global as an 'in between'.

As you referred to the unimitable dj, having the solution to this tiny problem, have one of you perhaps any comments on this?

Thanks

Harryk

Link to comment
Share on other sites

This topic is 7856 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.