May 23, 200322 yr Newbies I am having a very strange issue with a text calculation, here is the scenario: 1. I have a text field that gets set with a script 2. I have two other fields that each grab a portion of that text field after it gets set. (I am emulating a multi-column layout on a page by splitting a field with two calculations) It is working well, with one exception: It removes the punctuation from the end of each calculated field! Pretty strange to me... Is there something I can do in my calculation that will preserve the punctuation at the end of the text? Or is there another way to do this that would preserve it. I am using "LeftWords(field,number) for the first column, and MiddleWords(field,start,number) for the second column. Thanks in advance for any help you can give me.
May 23, 200322 yr Hi Eric, Welcome to the Forum! The problem you are having is due to the Function you are using MiddleWords - this literally picks up words, not punctuation. If you use Middle() then this picks up the Punctuation, the only problen you have now is how to work out the number of characters to put in each column rather than number of words! I assume there is always the same number of words in the main text field if you are specifying the number of words to extract in your example? Can you post a couple of examples of the text you are using? Ed.
May 23, 200322 yr You may be able to solve it by using the Position function, i.e. Left(field, Position(" ")) -- this is a quick markup, untested and un-debugged, but it might solve your problem.
May 26, 200322 yr Using RightWords() rather than MiddleWords() will preserve the punctuation at the end of the text if you can adapt your calculation.
Create an account or sign in to comment