DanBrill Posted December 22, 2003 Posted December 22, 2003 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
ESpringer Posted December 22, 2003 Posted December 22, 2003 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...
DanBrill Posted December 22, 2003 Author Posted December 22, 2003 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
ESpringer Posted December 22, 2003 Posted December 22, 2003 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...
DanBrill Posted December 22, 2003 Author Posted December 22, 2003 That's what I need! Never having been a fan of the RFs I never noticed that option down there. Thanks. Dan
bruceR Posted December 22, 2003 Posted December 22, 2003 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.
cjaeger Posted December 22, 2003 Posted December 22, 2003 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)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now