>Thanks Mark,
>Actually, I need to check if there are characters outside of a list of valid characters. For example A-Z,a-z,0-9, are valid characters, how can I tell if an address has a value outside of these. I know I'm going to be using ASCII values, but what's the best way to search through the string? I use your method a lot myself when I know what I'm looking for. In this case it could be a rather large set of invalid characters, so I don't think it would be the best choice here. Thanks again.
>Marcus.
>
>>Marcus,
>>If you want to remove the characters (not just locate them) then I recommend STRTRAN:
>>
>>
pcName = STRTRAN(pcName, "#", "")
>>pcName = STRTRAN(pcName, "!", "")
>>pcName = STRTRAN(pcName, "$", "")>>..and so on...
>>
>>This function is nice because it removes
every instance very quickly.
>>Mark
>>
>>>I need to check names and addresses for invalid characters. What do you guys think is the best command/function to use for this. Thanks for your help.
>>>Marcus.
A quicker way is
pcCleanName=ChrTran(pcName, "!#$%&/()=\|@{}[]"+chr(34), "")
if pcCleanName#pcName
endif
The "!#$%&/()=\|@{}[]"+chr(34) list is what I'd include in bad characters (and chr(0) to chr(31), plus chr(127). Many other characters are completely valid - you can find them in names of many people around UT.