Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calculating the number of lines used in a text box

Featured Replies

I have written a small invoice solution in Filemaker 8.5 Advanced. There is a description field for each job that's shown and when they appear on the invoice layout, the sliding/printing means the rows only take up as much size as they require.

However If there are too many entries or too many lines of text on some of the descriptions, the final invoice page can go on to a second page.

I don't really want this to happen (filemaker doesn't seem to deal with headings well on more than 1 page) and would rather a warning appears as soon as the descriptions go above a certain amount of lines of text.

Is there any means of easily calculating the number of lines of text used in a text box (a carriage return would increase the line by 1). I was hoping to add a calculation field with something 'like' Get(TextLineCount) or perhaps calculating the number of times a carriage return occurs in a text field.

I could then fire up a graphic container that has a warning triangle as soon as that limit has been reached.

Thanks in advance. :

Edited by Guest

  • Author

Looks like I may have figured it out just after posting.

I made sure the text field 'Description' used courier (fixed font width which gives 70 characters per line) then used:-

(Length ( Description )+(PatternCount ( Description ; "¶" )) * 70)/70

I need to figure out how to round values like 2.03 up to 3, but I think I'm on the right track :

[edit]

In case anyone else interested.

Just found ceiling command. So it works fine now :

So number of lines used in a text box calculated by:-

Ceiling ( ((Length ( fieldname )+(PatternCount ( fieldname ; "¶" )) * x)/x) )

where x is the number of columns.

(There may be a better way of doing this, I'm sure someone will point it out : ).

Edited by Guest

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.