Sort

yves COPPE yvescoppe at skynet.be
Thu Aug 29 11:38:01 CDT 2002


>Hi Yves,
>
>One work-around that's always available, is to first
>convert the lines to capitals with the toUpper()
>function. This will get rid of the diacritical marks.
>
>If there is no built-in way to change the
>diacritical-sorting (couldn't find any right away in
>the docs), you could always:
>
>   put toUpper(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
>
>And then resultVar should be pretty close to what you
>want. It will eat some memory of course...
>
>Hope this helped,
>

Hi Jan and Ken

Try this :
on mouseUp
   put "école"&cr&"fusée"&cr&"soleil"&cr&"appareil" into tData
   answer InternationalSort(tdata)
end mouseUp


function InternationalSort sourceVar
   set the wholeMatches to true
   put toUpper(sourceVar) into upperVar
   put upperVar into sortVar
   sort lines of sortVar
   repeat for each line theLine in sortVar
     put line (lineOffset(theLine, upperVar)) of \
         sourceVar & return after resultVar
   end repeat
   delete char -1 of resultVar
   set the wholeMatches to false
   return resultVar
end InternationalSort

IT DOES THE SAME AS THE SORT LINES Command !!!!

So there is no difference for me and the alfabet is not correct in french

if I write : sort lines of tdata international, it's worse !!!!

any other idea ????
-- 
Greetings.

Yves COPPE

Email : yvescoppe at skynet.be



More information about the use-livecode mailing list