Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I'm looking for some help with a script for final keywords that needs to substitute keywords from a related table. This was working fine until I exceeded 1000 records in the related table that the replacement keywords come from. Apparently Filemaker has a 1000 row or record limit for this kind of script. Does anyone know a work-around for this? Here's the script I'm using: 

1485947452_ScreenShot2019-08-04at11_14_50AM.thumb.png.fdeef130973aea33164cea57a485dbdb.png

Posted (edited)

The Substitute() function has a limit of up to 999 search/replace pairs. If you're getting your pairs as a list from a related table, it should be easy to split the list to chunks of up to 999 values, using a loop and a calculation of:

MiddleValues ( $listOfValues ; 999 * ( $i - 1 ) + 1 ; 999 )

 

Or perhaps it might be simpler to have the script loop over the entire list and perform a single-pair substitution at each iteration?

 

Edited by comment
Posted

Thanks for your response. I have limited FM scripting skills, so I need a bit more help on how to implement that. Someone else wrote the original script, so I'm not even sure exactly how it's working. Would I use a loop within my loop? Do I use the MiddleValues function within my Substitute function? Sorry for the dumb questions. I would gladly pay someone to just fix this for me. 

Posted
17 minutes ago, Schneids said:

I'm not even sure exactly how it's working.

I am not sure either, since I can't see the actual data it's working with.

Posted

The data comes from an extremely simple table, with just a few fields. See attached. 

Screen Shot 2019-08-04 at 12.27.03 PM.png

Posted (edited)
21 hours ago, Schneids said:

See attached. 

I am afraid that does not allow me to see your script in full context. It seems to be doing more than just substitution.

Have a look at the attached demo. It shows the simplest method to perform multiple substitutions, with no limit on their number (other than available memory). Note that this works on a single record; if necessary, you can add an outer loop to do this for all records in the current found set.

Also keep in mind that (a) the Substitute() function is case-sensitive and (b) subsequent substitutions are nested, so the order can matter.

 

MultiSubstitute.fmp12

Edited by comment

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