marysilvaramos Posted November 10, 2004 Posted November 10, 2004 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) & "
RalphL Posted November 10, 2004 Posted November 10, 2004 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.
marysilvaramos Posted November 10, 2004 Author Posted November 10, 2004 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
Lee Smith Posted November 10, 2004 Posted November 10, 2004 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
RalphL Posted November 10, 2004 Posted November 10, 2004 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
transpower Posted November 10, 2004 Posted November 10, 2004 Just wondering: why cannot the text box itself be shrunk (in Layout mode) so that no more than 40 characters fit on a line?
-Queue- Posted November 10, 2004 Posted November 10, 2004 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.
marysilvaramos Posted November 11, 2004 Author Posted November 11, 2004 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
Lee Smith Posted November 11, 2004 Posted November 11, 2004 Makes me wonder if you looked at the files by Bob Weaver that I pointed you to?
marysilvaramos Posted November 11, 2004 Author Posted November 11, 2004 Yes, Lee. I looked them. Thanks for send the links. They refer to scripts solutions and I need a calculation. Thanks Mary
Lee Smith Posted November 11, 2004 Posted November 11, 2004 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
transpower Posted November 11, 2004 Posted November 11, 2004 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.
marysilvaramos Posted December 6, 2004 Author Posted December 6, 2004 Hi Everybody: I finished the calculations to parse the text fields (264!!). The report runs beatifully... Thanks very much for all your help!! Mary
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now