Your "request for help in creating custom functions" would appear to be a request for someone to create them for you. Do you know how to use recursion in a custom function to get one that loops through data such as the words in a text string? Are you familiar with the text functions that come with FileMaker such as the position function and the Leftwords, RightWords and MiddleWords functions?
Sorry, wasn't asking to have them made, but since I was unable to find any resources similar, I was afraid it might not be possible.
Here's where I am now...
afterWords ( text ; prefix ; startingWord ; numberOfWords )If (PatternCount ( text ; startingWord )>0 ; prefix &Let ( [ len = Length ( startingWord ) ;pos = Position ( text ; startingWord ; 1 ; 1 ) ] ;Case ( pos ; LeftWords ( Right ( text ; Length ( text ) - pos - len ) ; numberOfWords ) ) ) )beforeWords ( text ; startingWord ; numberOfWords ; suffix )If ( PatternCount ( text ; startingWord )>0 ;Let ( [len = Length ( startingWord ) ;pos = Position ( text ; startingWord ; 1 ; 1 ) ] ;( RightWords ( Left ( text ; (pos - 1) ) ; numberOfWords ) ) & suffix ) ; "" )
Both seem to work, but I would be very open to any feedback as I'm not super confident as to how well they'll hold up. I'm using these functions on upward of 200+ character text strings where the startingWords can be repeating (multiple instances) but sometimes are not. In the end I want to be able to parse these chunks of text into pieces that I can later reconstruct into single records.
I very much appreciate both your responses above. For what I am doing though, I only know theStartTag and that I either need an unknown amount of the string preceding it or following it - and that theStartTag varies both in name and instance. I'm sure my explanation is just as bad as my calculation and I apologize.
If you could guide me to any more advanced resources, I sure would be extremely thankful.
Brian Dunning hosts a searchable site where people can submit their custom function designs for the benefit of others. You can web search FileMaker Custom Functions and find it pretty easy. You may find it a useful way to avoid re-inventing what someone else may have already figured out as well as using them as a source of ideas for how to set up a custom function.