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.

RightWords cuts off characters such as ) . ! -

Featured Replies

I noticed that using LeftWords and RightWords cuts off certain characters such as punctuation. Is there a way to not have it do this?

""" 1-" & LeftWords(IN1A, 14) & """", "")

Larry

  • Author

Did some playing around with the above. One observation:

Left( IN1A, Position( IN1A, " ", 1, 14 )

It seems that it worked in my file if the text in the field IN1A started with the character (

But it did not display any of the text from IN1A if it started with a regular text character.

Any way to make it work for both ways?

LR

Hmm. Left( IN1A, Position( IN1A, " ", 1, 14 ) ) should return all text from the beginning of IN1A to the 14th space. If there is no 14th space, that would pose a problem. The presence or lack of open parenthesis should not affect the result.

  • Author

Left( IN1A, Position( IN1A, " ", 1, 14 ) )

I think this assumes the length of words is exactly 14 or something. What I am after is that I want to get JUST the first 14 words of a field, regardless of how many words exist. If there is only 6 words, then I get only the 6. If there is more than 14, I only get the first 14. If the sentance starts with a non-text character, I still would like to capture that as well.

For example if the field contains:

(SR29) for exactly the same price as the discontinued SR20, SR21, SR22 and the SR23.

Then I want to capture only the first 14 words:

(SR29) for exactly the same price as the discontinued SR20, SR21, SR22 and the

And yet still have it work if the field contains a shorter phrase:

Discontinued product line

Then this is what gets captured even though it is less than 14 words:

Discontinued product line

Larry

Try Left( IN1A, Position( IN1A, " ", 1, Min( PatternCount( IN1A, " " ), 14 ) ) ). The Min determines if 14 or the number of spaces in the field is smaller and uses the lesser of the two.

  • Author

Perfect...

Left( IN1A, Position( IN1A, " ", 1, Min( PatternCount( IN1A, " " ), 14 ) ) )

Now I want to add just one thing:

1. Add a "

Left( IN1A, Position( IN1A, " ", 1, Min( PatternCount( IN1A, " " ), 14 ) ) ) & "

  • Author

I Appreciate all the help. This one seems to be a tough one. I added a If statement to the start and adjusted the word count to 11 to test something:

If(not IsEmpty(IN1A), "1- " & Left( IN1A, Position( IN1A, " ", 1, Min(PatternCount(IN1A, " "), 11))), "") & "

Ah, the first part needs a IN1A & " ", similar to the second part. If there are six words, there are only five spaces. So try changing the Left portion to

Left( IN1A, Position( IN1A & " ", " ", 1, Min( PatternCount( IN1A, " " ), 14 ) ) - 1 )

  • Author

Left( IN1A, Position( IN1A & " ", " ", 1, Min( PatternCount( IN1A, " " ), 14 ) ) - 1 )

It is beyond me how this one is supposed to work. And I thought I had a pretty good understanding of FM

Still does not quite work.

1.If there are less than 14 words in the IN1A field, then the above calc always cuts off the last word. So if IN1A contains 7 words, the above calc only shows 6.

2. If IN1A contains more than 14 words, then the above calc does work, and only shows the first 14 words, including non-text characters as it is supposed to do.

Larry

Same problem, add & " " after PatternCount( IN1A

  • Author

That one finally did it. Thanks.

This one I am using in conjunction with xmChart. There is only so much room for the legends on the charts, basically 2 lines no more than 14 or so words each line. With this I can show that, and anything over that just gets cut off.

Larry

Create an account or sign in to comment

Important Information

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

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.