ExtractListFromHtml ( AnyText ; Html ; theStartTag ; theEndTag )
Recursive function, returns a list of every possible subset, of any length, of characters contained between theStartTag and theEndTag.
Average rating: 5.0 (1 vote) Log in to vote
Gennaro BONATESTA - Show more from this author
"LIST" & ¶ ;
"span class=\"text\">Anna Fontana/span> " & ¶ &
"span class=\"text\">Annamaria Di Pinto/span> " & ¶ &
"span class=\"text\">Antonio Palumbo/span>" ;
"span class=\"text\">" ;
Annamaria Di Pinto
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
WHY THIS TECHNIQUE IS NEEDED:
1. FileMaker custom functions do not support looping statements (Do, While, For-Next) or line-jumping (GoTo).
2. FileMaker custom functions do not support the use of "optional parameters" (parameters that do not have to be included with the function call), which might help to simulate some of the above functions.
The code demonstrated in this function shows how to create a conditional loop using Case(), Let(), Recursion, and a local script variable ("$", not "$$").
Using this technique, you can create a loop with the ability to perform different actions at each "step" in the loop (1, 2, 3, etc.).
1. Tested using FileMaker 17 - should work from v15.
2. Has dependencies on the custom function ParseData ( theText ; theStartTag ; theEndTag ; theOccurance ) - https://www.briandunning.com/cf/559.
1. I did not invent this technique. It has been in existence for a long time. I am just showing a simple example for people who want to include some sort of looping mechanism inside of a FileMaker custom function, and haven't tried this method before.
2. FileMaker has a limit of 10,000 nested recursions per function call. Therefore, it makes sense to use this technique for an internal loop counter, but it is not good to use this technique for looping through large data sets (in that case, you might want to check out the looping capabilities of FileMaker scripts, which have fewer limits).
3. You will need a copy of "FileMaker Advanced" to *create* a custom function, but functions that have been created with "FileMaker Advanced" and saved into a database, can be freely used by "FileMaker Pro" clients who access that database.
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.