Finding and sorting by diacriticals again

Richard Gaskin ambassador at fourthworld.com
Tue Mar 11 20:30:00 EST 2003


Wouter Abraham wrote:

> Put the desired sort order into it. Use the following format as this is
> easier to edit (the script will make one long string of it).
> For example:
> 
> 0123456789
> AaÁáÀàÂâÄäÃãÅåÆæ
> Bb
> CcÇç
> Dd
> EeÉéÊêËëÈè
> Ff
> Gg
> Hh
> IiÍíÎîÏïÌì
> Jj
> Kk
> Ll
> Mm
> NnÑñ
> OoÓóÒòÔôÖöÕõØø‘¦
> Pp
> Qq
> Rr
> Ss
> Tt
> UuÜüÚúÙùÛû
> Vv
> Ww
> Xx
> Yyÿ
> Zz
> 
> 
> function ctnSort pTextToSort
> get the SortOrder of me              #### that is if the custom
> property is also in the same object as the script
> repeat for each line kk in it
> put kk after so
> end repeat
> set the caseSensitive to true     #### important to make the offset
> function work correctly
> repeat for each item ii in pTextToSort
> repeat for each char cc in ii
> put offset(cc,so) & space after tempVar
> end repeat
> delete last char of tempVar
> put tempVar & "," & ii & cr after theSorter
> put "" into tempVar
> end repeat
> sort lines of theSorter numeric by first item of each
> repeat for each line ll in theSorter
> put item 2 of ll & "," after theResult
> end repeat
> delete last char of theResult
> return theResult
> end ctnSort

Way cool. Thanks for posting that.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge 2.2: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list