Jump to content
Server Maintenance This Week. ×

Trim4 problem? (or my use of it?)


This topic is 5323 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 5323 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.