October 6, 200916 yr 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.
October 6, 200916 yr Author 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.
October 6, 200916 yr Could you post a copy of the actual text that is in the field, including the before and after spaces, returns, etc. Lee
Create an account or sign in to comment