>Dragan,
>
>Then simply localize the string of lower case letters to a #define or a lookup if the app really needs to deal with multiple languages.
>
>chrtran() is going to be an order of magnitude faster (probably 2 orders faster than the RegExp solution) than the other solutions that involve several lines of VFP code along with several function calls.
>
>>Exactly what I wanted to write - and I like this better, because it's language independent. Any solution where we list "abcd..xyz" will break in any other language except English and Latin.
Actually, I'd rather make this a class, and build such a string like this, in its .init:
this.lcChars=""
for i=32 to 255
lcChr=chr(i)
if isalpha(lcChr)
this.lcChars=this.lcChars+lcChr
endif
endfor
I've found IsAlpha() function to be correct for codepages I used so far; having this run only once would make the speed a non-issue, and then the chrtran() would be language correct as well. And we wouldn't have to do anything to do to the app if it's moved to another language, as this would respect the local ANSI codepage setting.