How to sort array regarding international characters?
Posted: Tue Sep 22, 2009 6:52 am
Do anybody know, how to sort array regarding international (polish, deutsch) characters?
Best regards, Marek
Best regards, Marek
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://mail.hmgforum.com/
I don't know whether it is legal or not to quote this in this manner. If I did any wrong, please warn meHello Sasha,
I don't know if it helps you, but I use a function for creating my own index. I
use it to set the order of plantnames in the way I want it. Lots of plants have
special characters in the name (like ä, é...) and I translate all these
characters in a function. Below is an example. It is very important that if you
replace characters, at the end of the function the length of the indexed value
is as long as at the start of the function.
example:
FUNCTION NameIndex(indexText)
beginlength = LEN(indexText)
indexText= UPPER(omzetnaam)
indexText= STRTRAN(indexText, CHR(0192), 'A') && À
indexText= STRTRAN(indexText, CHR(0193), 'A') && Á
indexText= STRTRAN(indexText, CHR(0194), 'A') && Â
indexText= STRTRAN(indexText, CHR(0195), 'A') && Ã
indexText= STRTRAN(indexText, CHR(0196), 'A') && Ä
indexText= STRTRAN(indexText, CHR(0197), 'A') && Å
indexText= STRTRAN(indexText, CHR(0198), 'AE') && Æ
indexText= STRTRAN(indexText, CHR(0199), 'C') && Ç
indexText= STRTRAN(indexText, CHR(0200), 'E') && È
indexText= STRTRAN(indexText, CHR(0201), 'E') && É
indexText= STRTRAN(indexText, CHR(0202), 'E') && Ê
.
.
.
.
endlength := LEN(indexText)
spaces := beginlength - endlength
indexText := indexText+ SPACE(spaces )
RETURN indexText
When you index a file do it this way:
INDEX ON NameIndex(cField)
Rene