Jump to content

Controlling text in the LeftWords calculation


This topic is 2810 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have two text fields, text1 and text2.

 

Text2 is a product summary, consisting of the first paragraph from text1; text1 is a product description and varies from record to record.

 

I set up the following to automatically populate text2:

 

text2=LeftWords ( text1 ; Position ( text1 ; "all words left of the first paragraph symbol" ; 1 ; 1 ) )

 

The problem I'm having is what goes where I typed above "all words left of the first paragraph symbol". How to tell FileMaker Pro to find and recognize text control values? For example, many word processors would recognize ^p^ as a paragraph marker.

 

I tried various combinations with and without "" from this page: http://www.fileformat.info/info/unicode/char/001e/index.htm

 

But no success because obviously there is some text encoding that I don't understand. So the question is: how does FileMaker Pro find and use the paragraph character in a block of text please?

 

Thanks.

 

I'm using FileMaker Pro 13 Advanced on a Mac.

Link to comment
Share on other sites

Your question is very difficult to understand. Before describing what you did (and doesn't work), please explain what you're trying to do. Seeing an example or two of what you have in the first field, and what you want to have as the result in the second one, would be also very helpful.

 

--

P.S. Please use the default font for your posts.

 

 

P.P.S As a shot in a dark =

GetValue ( Textfield ; 1 )

will return all text before the first carriage return in Textfield. And so will this =

Left ( Textfield ; Position ( Textfield ; ¶ ; 1 ; 1 ) )

Note that this uses the Left() function, not the LeftWords() function. The ¶ symbol is the text operator for a carriage return - see: http://www.filemaker.com/help/13/fmp/en/html/non_toc.46.41.html#1029503

Edited by comment
Link to comment
Share on other sites

My question might be hard to understand, but your response is the opposite- it's direct and full of the info I need- i think. It's the end of a long day for me so I'll post direct answers tomorrow. Thanks for the help.

 

ps: not sure how I screwed up default font.

Link to comment
Share on other sites

n.p, I already corrected it.

 

Just FYI, that's not the default font either. If you look under the hood, you'll see it's formatted as:

 

size=4 font=verdana, geneva, sans-serif

 

Here's the difference:

 

I have two text fields, text1 and text2.

I have two text fields, text1 and text2.

Link to comment
Share on other sites

Just for your information, I always use Verdana 14 so I can see the post with my  old eyes.

 

 

You know if you want to be a moderator, you can have my job.

Link to comment
Share on other sites

You know if you want to be a moderator, you can have my job.

 

Please don't do that. I wasn't criticizing you in any way, and you know very well my appreciation for all the efforts you put in here. My complaint was to the OP for not using the default font. It may be too small for your and my eyes - but I would rather have all posts be the same than having to adjust my eyes anew for each post. So when you said you have corrected the problem, I thought (and still think) I was in order to say what I said.

Link to comment
Share on other sites

A fuller response:

 

My solution has a text box called Product Description- it is quite lengthy. We needed a much shorter 'blurb' that describes the main characteristics of the item. As it turns out, the first paragraph of the Product Description is perfect.

 

Is this the best approach? Maybe not, but it works for us, and thanks for the help. 

Link to comment
Share on other sites

Is this the best approach?

 

Not sure which "this' you mean. To get the first paragraph of a text field, I believe =

GetValue ( Textfield ; 1 )

is the simplest and (therefore) the best. And unless you need to further modify this paragraph, it would be best to use a calculation field for this purpose.

Link to comment
Share on other sites

This topic is 2810 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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