Brian Dunning's FileMaker Custom Functions

ActualLineCount ( Text ; CharsPerLine )

Determine if text is overflowing field bounds on layout.

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

Jonathan Stark   Jonathan Stark - Show more from this author
Jonathan Stark Consulting
http://jonathanstark.com/

Share on Facebook Share on Twitter

  Sample input:
ActualLineCount ( Overflow::Text ; 30 )
  Sample output:
6

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

Have you ever needed to know if data is overflowing the boundaries of the field in which it is being displayed? For example, maybe you want to use conditional formatting to notify the user that they have entered too much text to be displayed on a printout. This can be a tricky thing to determine when data can contain carriage returns.

This custom function will solve the problem for you, with a couple of caveats:

- You need to use a monospace font on the field

- You can not allow tabs in your data because it is impossible to determine where the tab stops are. Since you have to use a monospace font anyway, you can use an autoenter calc to replace tabs with 4 spaces.

- You might want to add a platform check to address font size differences on Mac and Windows.

 

Comments

Mike B   Mike B
Sep 3, 2019
I can't seem to make this work? Could someone check this to see if it's working for you?
 

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.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: