Jump to content

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

Recommended Posts

Posted

OK, so about 2 days ago I stated somewhere here in the forum that there was almost never a good reason to use repeating fields. Well, as luck would have it, I've gotten myself into a situation in which they might actually be a good idea.

I have 2 questions that I can't find in the documentation. First, is it possible with a script step, or better yet a calculation function, to set a particular repetition of a field? Something like

SetField [Field1, valueX, rep 1]

SetField [Field1, valueY, rep 2]

So repetition 1 would be X and repetition 2 would be Y.

Second, is it possible to have a field on a layout so that only its used repetitions are displayed?

Thanks,

Dan

Posted

Dan,

As far as I know, the only way to get a calc field to hold different values in different iterations is to make the calc point to another repeating field. So, for example, if another repeating field holds

A

B

C

in three reps, you could make a repeating calc field return:

Here's a fancy calculation on A

Here's a fancy calculation on B

Here's a fancy calculation on C

Gee, I don't think you can hide the repetitions differently for different records in a layout except in preview mode...

Posted

Hey E,

This is progress. I see how the repeating calculations work now, and I could live with this only in preview mode and print jobs. (I'm assuming that this is a sliding / printing remove empty space issue. ? )

So is there any way to script how data gets into a particular repetition? Suppose I have 3 variables. Can I script it so that ValueA becomes ValueC's first repetition, and ValueB becomes the second repetition?

Thanks,

Dan

Posted

Sure, if I follow your task: When you use "Set Field..." in the script-maker, you can specify target field--including which repetition to set--at the bottom of the specify field dialogue...

Posted

OK, so about 2 days ago I stated somewhere here in the forum that there was almost never a good reason to use repeating fields. Well, as luck would have it, I've gotten myself into a situation in which they might actually be a good idea.

What situation is that? What you're currently describing is another situation where they don't work and you have to ask questions about how to work around repeating field limitations.

Posted

Hi Dan,

when working with repeating fields it can be helpful to create an index, which is basically a RF with values from 1 to # of repetitions. That way you can reference the rep# by index value. You will find that technique in several of my sample files. I use it mainly for type-aheads or for calcs like in my barcode solutions, as it saves me long calcs with ascending numerical values, aka

Middle(field;1;1) & Middle(field;2;1) & Middle(field;3;1) ...

becomes

Middle(Expand(field);repindexfield;1)

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