>>Does anyone know a simple command to get rid of all non-printable characters from a field. I have a nomenclature field and the user has been entering some carriage returns, tabs, and control characters (inadvertantly) Is there a way that I can get rid of those characters and leave the alpha numeric printable stuff. I know I can do a loop reading every character and checking for its ascii value, but what I was looking for was a function that can be used in a replace statement. TIA
>
>The easiest thing to do would be to create a string containing all characters you want filtered from the file, and then do the following
>
>* I assume that cFilteredChars contains the list of characters to remove
>* and cFld is the field to be stripped
>REPLACE ALL cFld WITH CHRTRAN(cFld,cFilteredChars,'')
>
>putting together the list should require a little work; essentially, if only standard printed ASCII characters were acceptable, then you could build cFilteredChars at least in part using:
>
>
cFilteredChars = ''
>LOCAL i
>FOR i = 0 TO 31
> cFilteredChars = cFilteredChars + CHR(i)
>ENDFOR
>FOR i = 128 TO 255
> cFilteredChars = cFilteredChars + CHR(i)
>ENDFOR
>
>You could then concatenate any others you want to strip.
Thanks Ed. I will run some tests and see if I can get this implemented.
Bret Hobbs
"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope