Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


Privacy Policy

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.


 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

Hilite(SourceText; SearchText; R; G; B)

Rate this function:  

  Average rating: 3.9  (52 votes)
  Discuss this Custom Function

Ray Cologon, NightWing Enterprises

This function highlights all occurrences of a specified word or phrase in a block of text.

Sample Input:
Any block of text.
Sample Output:
The same block of text with formatting applied (can't show here because only plain text is accepted on this form).

 Then copy & paste into FileMaker Advanced's Edit Custom Function window.


Locating occurrences of a word or phrase within a large block of text helps users to locate items of interest. This function utilizes recursive syntax to search the source text and apply bold and colored formatting to all ocurrences of the search string (regardless of case).

Because this function modifies the form but not the content of the supplied text, it is suitable for use in an auto-entry calc which sets the field to itself - providing transparent and automatic search and highlighting functionality.

Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it


5 most recent comments | Show all 7 comments

Hi Doug,

I suspect the problem you are experiencing may lie somewhere else other than the custom function. I have seen it running in a number of FMP 12 solutions without incident.

Just to be sure, I just created a brand new v12 file with a couple of fields, added the CF copied pasted directly from this page and set a text field (containing about 20 lines of text) to itself multiple times, highlighting various different search terms. It worked flawlessly each time, no chugging (result was returned instantly) and no crash.

Presumably there is something in play in your case beyond the points you've mentioned. Eg how much text is in the field you're running the process on? Does it work with just a few lines in the source field - if so you may be breaching stack overflow limits (which are the same in v12 as in previous releases, FWIW).

Ray Cologon, San Diego
August 14, 2013 5:34pm


I am using your function since years. Once in a while, however, I observed that the text in the HiLite-Field doesn't show up. Instead, a question mark appears.

Finally, I checked the reason and found out that whenever the length of the SourceText is larger then 10.000 characters the function doesn't work anymore.

Is there a possibility to change this, or do I have to split the SourceText in various portions?

Jobst Gmeiner

Jobst Gmeiner, Darmstadt/germany
June 04, 2017 12:01pm

Hi Jobst,

I have not encountered the issue you are describing.

Just to be sure, I just created a brand new file in FileMaker 16, created a couple of fields, added the CF copied pasted directly from this page and set a text field to contain a number of lines of text and a calculation to highlight search strings entered into another field. It worked flawlessly each time, regardless of the length of the SourceText I supplied (my tests included SourceText strings of over 100 characters and the function continued to work as intended).

Presumably there is something in play in your case beyond the points you've mentioned, but it's not clear from your description what that might be.

Ray Cologon

Ray Cologon, Melbourne
June 04, 2017 1:22pm

Hi Jobst,

My apologies, I now see that I misread your message, and your reference to the SourceText is in EU number notation and you are referring to strings longer than ten thousand characters (we use a different number convention here and I'm afraid I read your message as referring to only 10 characters).

The ten thousand character limit is a result of the stack depth limit imposed on standard recursive operations by FileMaker, and this function uses standard recursion, so by its nature it is limited to input strings of ten thousand characters or less.

It would be possible to create an alternative function using tail recursion, that could process strings of up to fifty thousand characters (after which it too would fail), but that would require significantly different syntax.


Ray Cologon, Melbourne
June 04, 2017 1:29pm

Hi Ray,

yesterday, I came back to the problem of SourceText limitation again and found your answer. Thank you and sorry for the wrong notation of the number ten thousand.

meanwhile I could circumvent the problem with a filemaker script:
Whenever I open the file with the SourceText. the script splits the SourceText into portions of 9999 characters, puts them into separated fields with the corresponding HiLite fields. Finally, the HiLite fields were combined again into one field, the hilights are preserved.

It works perfect and even fast enough with a file containing more than twenty thousend records.

Best regards,

Jobst Gmeiner, Darmstadt/germany
June 30, 2017 8:44am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 7 + 5 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. SortList ( theList )
  (Sat, Jun 23, 8:45am)
2. HexUUIDToNum_cf (_uuid)
  (Sat, Jun 16, 1:55pm)
3. httpResponseCode ( responseHeaders )
  (Tue, Jun 12, 10:40pm)
4. FindDuplicateCharacters ( string )
  (Fri, Jun 08, 5:01pm)
5. FieldRepetitionLast ( field ; maxRepetition )
  (Wed, Jun 06, 6:05pm)
6. CountModifiedRecords ( NameTimestampField ; StartTimestamp ; EndTimestamp )
  (Mon, May 28, 8:23am)
7. JSONArrayLength ( JSONArrayStr )
  (Fri, May 25, 7:46am)
8. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)

RSS Feed of Custom Functions