October 5, 201114 yr Can you help? I am trying to use a calculation to populate a repeating field. I did it with a script... and now I want to do it as a calc to speed up the process. I have a file name... I'm trying to identify all the positions of the character / in the file path. So I have a repeating field with 15 repeats. I set the field as a calc... and then the first calc is Position ( server_string ; "/" ; 0 ; 1 ) Works great, now I want repeating field 2 to grab the position of the 2nd instance, repeat 3 to grab the position of the 3rd instance and so on. I know how to get data from repeating fields, but how do I put the data in it as part of the calculation? thanks for any help. steve
October 5, 201114 yr yep, that is the problem with repeating fields. there's GetRepetition, but there's no SetRepetition! you could poke around some more with the Extend function, only to find yourself wanting to add some more repetitions later, or changing the logic. THEN, you might eventually come to the point where all this stuff becomes hard to read and maintain. that's why just about everybody will tell you to add a related table instead. most people use repeating fields only to store some graphics for interface usage or similar things, but not data that needs to be manipulated. just my 2c. stefan
October 5, 201114 yr Position ( server_string ; "/" ; 0 ; 1 ) Works great, now I want repeating field 2 to grab the position of the 2nd instance, repeat 3 to grab the position of the 3rd instance and so on. Try = Position ( server_string ; "/" ; 1 ; Get ( CalculationRepetitionNumber ) )
October 5, 201114 yr Author Thanks for the heads up. Using the calculationrepeitiionNumber is doing the trick. Just FYI, I'm not using it for dynamic data... but am using the field to break apart a long path name to feed data to individual calculation fields that connect to the related tables. Thanks for the tips gang. s
October 6, 201114 yr yep, that is the problem with repeating fields. there's GetRepetition, but there's no SetRepetition! Functions return results, they don't set fields.
Create an account or sign in to comment