August 30, 200421 yr 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
August 30, 200421 yr 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
August 30, 200421 yr 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.
August 30, 200421 yr 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
August 30, 200421 yr 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.
August 30, 200421 yr Author Perfect... Left( IN1A, Position( IN1A, " ", 1, Min( PatternCount( IN1A, " " ), 14 ) ) ) Now I want to add just one thing: 1. Add a "
August 30, 200421 yr Left( IN1A, Position( IN1A, " ", 1, Min( PatternCount( IN1A, " " ), 14 ) ) ) & "
August 31, 200421 yr 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))), "") & "
August 31, 200421 yr 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 )
August 31, 200421 yr 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
September 1, 200421 yr 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