November 30, 200421 yr Is there a way to create a trim function that will trim ALL non-printing characters? The built-in Trim function only takes care of leading/trailing spaces. Barring that, maybe I can set an "In range" limit on the field? But how would I do that if I wanted to include everything except non-printing characters? There are a number of odder characters (punctuation, foreign chars, etc.) I'd like to keep.
November 30, 200421 yr In v6, you can use nested Substitute() functions to replace any characters you want with nothing. In v7, you can enter a list of substitutions instead of using nested functions.
December 1, 200421 yr Author That's a good idea. Now how can I code somthing like a carriage return? Can I type it in hex or Unicode?
December 14, 200421 yr Well, the substitute function only substitutes each unique, non-overlapping instance of the substituted-for string. Let me use "a" instead of "" just to keep it clear (if only in my own mind ) Start with "aaa". Find every occurrence of "aa" -- there's only one, right? aaa or aaa. Now delete every occurrence of "aa" and replace it with something, anything, oh, i don't know, let's say "a", and we wind up with aa You can get around this feature/limitation (depending on your perspective) by iterating the substitution multiple times: Loop ..Substitute ( theField , ":paragraph::paragraph:" , ":paragraph:" ) ..Exit Loop If ( PatternCount ( theField , ":paragraph::paragraph:" ) = 0 ) End Loop HTH, Jerry
December 14, 200421 yr Or check out the substitute function Fenton showed in here: http://www.fmforums.com/threads/showflat.php?Cat=0&Board=custom&Number=134271
December 14, 200421 yr The algorithm can be translated to work in older versions (Bob Weaver's example that you sited used the original substitute() syntax. His was for eliminating spaces, but the same thing can be done for line returns.)
December 14, 200421 yr Hi Ender, Sorry, I guess I didn't make myself very clear. My question about v7, was regards to the Filter part of the calculation. Is that a version 7 feature, or did I miss something? Lee
Create an account or sign in to comment