Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hi people:

I need to parse several fields with long text lines. Each line should have a maximun of 40 chars. Here is a sample:

Multiple moles mainly on his back with

regular borders, flat, ranging in color

from pink, light brown to dark brown.

pin rom pink, light brown to dark brown.

pink keloid on left scapula, 2cm in

diameter keloid on left scapula, 2cm

in diameter

I created a calculation, but it does not work for all the cases that the text might have in terms of number of chars.

Case(

Round(Length( GeneralSkinCom.t )/40,0)>=2 and Round(Length( GeneralSkinCom.t )/40,0)<3,

Middle(GeneralSkinCom.t,1,40) & "

Posted

It looks like you are assuming that a space will occur every 40 characters. I think that is a bad assumption. You need to check where spaces occur and pick the ones that are 40 characters or less from the start of the line. This looks more like a script than a calculation.

I think I would use 2 fields to hold the text while working the script. One would contain the result and the other would hold the text to be parshed. When the break point is found add the left part to the result and use the right part as the text to be parshed.

Posted

Thanks RalphL for answer question.

I think that I have not explain myself enough about the problem. The calculation intents to print the content of the field in a section of a report. It only allows to print 40 chars (wide). The calculation needs to add the content of several text fields. I tried adding the fields in the report but because some are longer than others it does not print well.

Thanks again,

Mary

Posted

Hi Mary,

Take a look at these two files by Bob Weaver.

Contain Length of Line

Here

Count Lines of Wrapped, Styled, Non-monospaced Text

And Here

HTH

Lee

cool.gif

Posted

Mary,

I think I understand what you are trying to do. I put together a sample file with a script to parse the text sample. It looks like this:

Multiple moles mainly on his back with regular

borders, flat, ranging in color from pink,

light brown to dark brown. pin rom pink,

light brown to dark brown. pink keloid on

left scapula, 2cm in diameter keloid on left

scapula, 2cm in diameter

Posted

Just wondering: why cannot the text box itself be shrunk (in Layout mode) so that no more than 40 characters fit on a line?

Posted

I like Bob's Contain Length of Line sample, but I would use a value list sorted by a second Index field that is a lookup of the global Index, instead of hard-coding concatenation of the repetitions.

Posted

Thanks people for all the help that you have offered.

I do not want to place the field in a layout, range it until 40 char because a) There are 100 fields - in the same table - where the parsing process should be done.

: I did that before and when the text exceed the field long, the text was cut (you can hear the users complains)

The scripts will not work either. The time to process 100 fields will make my users complain (again)

Somebody sent me the following answer from another website.

http://www.maclane.com/cgi-bin/ultimatebb.cgi?/ubb/get_topic/f/2/t/002039.html#000002

It is a calc solution.

I have not try it, let see how it works.

Thanks again,

Mary

Posted

No, there are 3 approaches in the SplitText.fp5. Only 1 is a script, and other two are calculations.

That is why I asked. Look at the labels on the buttons, they take you to the different views, and there is a short note on each layout telling you what you are looking at.

Lee

wink.gif

Posted

Mary:

You say that you "did that before and when the text exceed the field long, the text was cut (you can hear the users complains)." No, the text should just wrap around, with nothing cut. In addition, you could use a mono-spaced font.

  • 4 weeks later...

This topic is 7361 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
×
×
  • Create New...

Important Information

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