K1200 Posted October 6, 2009 Posted October 6, 2009 I'm trying to use the Trim4 function to remove leading blanks, tabs and CRs from a block of pasted text (into Table::Text). I have a calculated field that is simply Trim4(Table::Text). The function works, except when there is an odd number of spaces immediately in front of the first character -- then the first character is dropped from the result. First, can someone confirm this behavior? Is there a valid reason for it working that way? I tried playing with the 1+C1 part of the definition by changing it to only C1 as the starting point. That fixed the leading space problem, but broke its ability to filter out CRs and tabs. Beyond that simple attempt, I'm unsure of what to try. I'll also mention that I tried to heed the caution about cutting/pasting the function code. It appears to be pasted in properly -- two blank characters followed by a tab and pilcrow. But how do I confirm what those blank characters really are? Should literals be used instead? Any help will be greatly appreciated.
K1200 Posted October 6, 2009 Author Posted October 6, 2009 Further investigation has revealed that it IS a result of the pasting of the characters in the function definition. What you paste is not what you get (as the Note cautioned). I've replaced the " " parts of the definition with Char(9) & Char(13) & Char(32) and Char(160) and everything appears to work. Pending further developments, I'll consider this resolved.
Lee Smith Posted October 6, 2009 Posted October 6, 2009 Could you post a copy of the actual text that is in the field, including the before and after spaces, returns, etc. Lee
Recommended Posts
This topic is 5538 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