sort accent char correctly

yves COPPE yvescoppe at
Wed Sep 25 12:13:01 EDT 2002

>An alternative sort routine was developed, and here's
>the resulting code:
>function myInternationalSort sourceVar
>   put myUpper(sourceVar) into upperVar
>   put upperVar into sortVar
>   sort the lines of sortVar
>   repeat for each line theLine of sortVar
>     put line (lineOffset(theLine, upperVar)) of \
>     sourceVar & return after resultVar
>   end repeat
>   delete char -1 of resultVar
>   return resultVar
>end myInternationalSort
>function myUpper pString
>   repeat for each char tChar in pString
>     put myUpperChar(tChar) after tString
>   end repeat
>   return tString
end myUpper

>   if toLower(pChar) is in "·ý’" then return "A"
>   if toLower(pChar) is in "ÈËÍ" then return "E"
>   if toLower(pChar) is in "™˜š" then return "U"
>   -- add some more lines for the other vowels...
>   if toLower(pChar) is in "Á" then return "C"
>   -- default is standard toUpper()
>   return toUpper(pChar)
>end myUpperChar
>Hope this helped,
>Jan Schenkel.

Hi Sylvain,

I had the same problem as you had.
So Jan wrote a function for me.
it works fine and very fast.
you can add as many "special" char you want in the function :
function myUpperChar pChar

Hope this helps.


Email : yvescoppe at

More information about the Use-livecode mailing list