Convert as mentioned by others does a character by character
replacement, so convert "abc" to "def" will convert all occurrences of
"a" to "d", all occurrences of "b" to "e" and all occurrences of "c" to
"f" in the target string.

If the "to" string contains less characters than the "from" string, then
the "to" string will be padded with null characters.  Which lets you use
the following technique, which is easy to maintain/modify and is very
fast, (at least on Universe).

ALHA.UC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ALPHA.LC = OCONV(ALPHA.UC, "MCL")
NUMBERS = "0123456789"
OKAY.PUNCTUATION.CHARS = "-/()"
*
GOOD.CHARS = ALPHA.UC: ALPHA.LC: NUMBERS: OKAY.PUNCTUATION.CHARS
*
*
INPUT SOMETHING FROM USER
BAD.CHARS = SOMETHING
CONVERT GOOD.CHARS TO "" IN BAD.CHARS
IF (BAD.CHARS) THEN
CRT "bad characters in input string ': BAD.CHARS: "'."
blah, blah, blah
END
*
*

And of course, you can mix and match your constant strings to determine
what GOOD.CHARS are allowable for a given input.





On 4/26/2012 9:19 AM, Bob Witney wrote:
> I use this :
> 
> Bit of a sledgehammer but it works and it's quick too
> 
>            FOR CHARACTER = 127 TO 249
>                CONVERT CHAR(CHARACTER) TO '' IN THIS.MESSAGE
>             NEXT CHARACTER
> 
> Gets rid of all sorts of nasty webby characters :-)
> 
> Bob
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to