How to sort array regarding international characters?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
mol
Posts: 3821
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

How to sort array regarding international characters?

Post by mol »

Do anybody know, how to sort array regarding international (polish, deutsch) characters?


Best regards, Marek
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How to sort array regarding international characters?

Post by sudip »

Hello Marek,

I saw something which may be helpful. I saw this in Yahoo Minigui group.
Hello 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
I don't know whether it is legal or not to quote this in this manner. If I did any wrong, please warn me :)

With best regards.

Sudip
With best regards,
Sudip
User avatar
mol
Posts: 3821
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How to sort array regarding international characters?

Post by mol »

Yes, I think, it will be very useful!

Many thanks, Sudip!
Post Reply