Brian Dunning's FileMaker Custom Functions

LongestString ( text )

Returns the longest string of a given text and its length.

  Average rating: 4.1 (31 votes) Log in to vote

Daniele Raybaudi   Daniele Raybaudi
ACI
http://www.aci.it

Share on Facebook Share on Twitter

  Sample input:
LongestString ( "This is a really long text string that Jonathan needs to display narrowly in a huge text field." )
  Sample output:
narrowly
8

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

LongestString custom function

Author: Daniele Raybaudi

Returns the longest string of a given text and its length; if more than one string has the same length, it returns the last.
A string is definited as a space separated part of text.

I had to find a way to stop a bug of the good WordWrap CF by Jonathan Stark: it fails when the "size" parameter is lower than the longest word of the given text.

 

Comments

Greg   Greg, Bennington, VT
Jun 19, 2014
Hello, I tried implementing on a current text field, but cannot get an sample output. I created a new text field as calculation, and set it to use the custom function. Do I need to pass any parameters to the function?
 
Daniele Raybaudi   Daniele Raybaudi, ACI
Jun 20, 2014
You'll need to create a calculation field, result text.
Also you'll need the Advanced version of Filemaker.
 

Log in to post comments.

 

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

Under construction. Email me your wish list for improvements.