There is no problem on my test.
I guess you didn't re-calculate after changing definition of custom function.
Or, didn't you change the function name? I couldn't get why the function has "Single" in the name.
***UPDATE*** SOLVED - I THINK!
After playing around with editing the HliteMulti to call on TextHighlightWithStyles it seems to work. Not sure how, but tinkering got there. Still don't know why I couldn't get HiliteSingle to work...
I've left the text of my original post below, but updated the attached test file with the functioning result.
Thanks for the replies.
I went back and retested the calculations, and I do now have Fabrice's TextHighlightWithStyles function http://www.fmfunctions.com/functions_display_record.php?functionId=268 working ok, so I must have mistyped something in entering the function.
However, I was very keen to get HiliteSingle to work, as Michael Horak also has a HiliteMulti custom function (which calls on HiliteSingle), which should allow for the highlighting of multiple different words rather than only one, which is actually what I need. (Hence haven't delved too deeply into the Nightwing solution either, as it also does a single word only)
Again, it seems others have had it work fine, so it must work...
I tried inserting the TextHighlightWithStyles into the HiliteMulti function in the place of HiiteSingle, but without success. I've attached a sample of the options I've explored.
Is Michael Horak still on the forum under another guise? I searched around and it seemed like maybe not?
test highlight.fmp12.zip 71.6 K
There are two problems with the HiliteSingle custom function in your file. Once you fix them, they should work fine.
Problem 1. Go to Manage Custom Functions and open up HiliteSingle. You'll see this:
In the Function Parameters section, you'll notice that you've got three parameters defined. The order is 1) searchString, 2) text, 3) color. Look down below in the definition area. You'll see that the order is 1) text, 2) searchString, 3) color. To fix this part, in the parameters section, move "text" to the top.
Problem 2 is in your calculation field.
HiliteSingle ( Get ( QuickFindText ) ; synopsis ; RGB (0;255;0) )
It should be:
HiliteSingle ( synopsis ; Get (QuickFindText); RGB (0;255;0) )
When you make those two changes, the formula should work correctly.
Thank you! I knew it must be something dumb I'd done. Now I have two ways to do it!