Custom Sorting — The Easy Way
Mac OS 9 Mac OS X Windows Linux

At 2:19 AM -0700 6/3/2002, Manuel Companys wrote:

>What would be nice is to have a parameter such as "sortSystem" : ASCII,
>languageA .... languageN, custom. "Custom" would allow defining a sorting
>system for special purposes.

You can sort by the returned value of a function. For example:
on mouseUp
  sort lines of field "Text" by useCedillas(each)
end mouseUp

function useCedillas theLine
  replace "ç" with "c" in theLine -- c-cedilla, option-c
  replace "Ç" with "C" in theLine -- C-cedilla, option-shift-c
  return theLine
end useCedillas
This simple example makes c-with-cedilla equal to c in the sort. You can see how this can be extended to create different sort systems.

Posted 6/3/2002 by Jeanne A. E. DeVoto to the Use-Revolution List   (See the complete post/thread)