GC GYM Posted December 7, 2009 Posted December 7, 2009 Hi People, I want to remove any carriage returns from a field (using auto enter calc.). I've read the forums and tried Substitute ( my text; ¶; "") and Trim ( Substitute ( my text; [¶; ""]; [Char(9); ""] )) I also tried to Filter() it out but no luck. Any suggestions?
MetaSys Software Posted December 7, 2009 Posted December 7, 2009 The calculation formula Substitute ( Fieldname ; "¶" ; "" ) does remove the cariage returns, after you commit the record. another option is to use script trigger 'OnObjectExit', instead of auto-enter calc.
Vaughan Posted December 7, 2009 Posted December 7, 2009 Do you want to remove carriage returns from within the text itself, or just leading and training returns? If it's just leading and trailing returns, use the Trim4 custom function on Brian Dunnings web site.
GC GYM Posted December 7, 2009 Author Posted December 7, 2009 I tried a few times using auto-enter calc. but they were still there.
comment Posted December 7, 2009 Posted December 7, 2009 I want to remove any carriage returns from a field (using auto enter calc.). Auto-enter calcs are triggered by input into the field (or into another field referenced by the calculation). Data already entered will not be modified, unless you do something.
Kris M Posted December 7, 2009 Posted December 7, 2009 (edited) find all records that you want to change. script::: go to first record start loop substitute as previously mentioned by others go to next record exit at last end loop this will cause the substitution that you want for all existing records.. future records should have the auto enter substitute calc Context is everything so make sure you run the script from an appropriate layout with the appropriate found set.. ps.. my comment was not directed at comment but at the originator.. sorry : ) Edited December 7, 2009 by Guest
Vaughan Posted December 7, 2009 Posted December 7, 2009 ... or do it in a single step using the Replace command, and specify the Substitute calculation.
GC GYM Posted December 8, 2009 Author Posted December 8, 2009 (edited) What I didn't explain well enough is that I wanted to remove any carriage returns entered by the user upon committing the record. I don't have any in my data now, I just don't want any put in during data entry. Using a Mac on a Windows network (in case that's significant) I entered data with returns and none of the methods mentioned (in my auto enter calc.) removed the returns when I committed the record. It's like the return is not being recognised at all since Filter function doesn't even remove them. Edited December 8, 2009 by Guest
Lee Smith Posted December 8, 2009 Posted December 8, 2009 Try the Trim4 Custom Function by Ray Cologon, I have used it and it is amazing. Link
comment Posted December 8, 2009 Posted December 8, 2009 Did you uncheck the 'Do not replace existing value…' option?
Recommended Posts
This topic is 5523 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