Newbies St Louis Eric Posted May 23, 2003 Newbies Posted May 23, 2003 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.
EddyB Posted May 23, 2003 Posted May 23, 2003 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.
danjacoby Posted May 23, 2003 Posted May 23, 2003 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.
BobWeaver Posted May 26, 2003 Posted May 26, 2003 Using RightWords() rather than MiddleWords() will preserve the punctuation at the end of the text if you can adapt your calculation.
Recommended Posts
This topic is 8192 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