My interest is that there be a Sort method that is "Langauge aware" and that it Not be driven by Locale. Letting Locale set a default sort method makes sense, but you should be able to override that default. As for CaseSensitive Sort, I have tried and failed to think of a situation where I wouldn't want a CaseSensitive Sort, assuming the Language has Case (Hebrew does not). It should also have "Property SortAscending: Boolean = True".
For me the only real issue is collecting the proper Sort methods (compare functions) for the different languages and constructing a wrapper to implement them. With the help of the Lazarus community, I don't think that should be difficult. On Tue, Dec 4, 2012 at 12:53 PM, Bart <[email protected]> wrote: > On 12/1/12, Avishai <[email protected]> wrote: > >> Lazarus support for Sorting is completely inadequate. .... > > At the risk of repeating myself or someone else: > > Every component that has a (string-based) sorting routine might also > have a CustomSort like: > > TBasicComponent.CustomSort(const CompareFunc: TCompareFunc); > where > type > TCompareFunc = function(Item1, Item2: Pointer): Integer; > > Or perhaps a property of type TCompareFunc that controls the default > sort routine? > > The challenge (for Avishai's point of view) would then be to supply > appropriate compare functions for different languages and situations. > The compare function also solves the "do i want case-sensitivity" issue. > > Just my 2 cents... > > Bart > > -- > _______________________________________________ > Lazarus mailing list > [email protected] > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- Shalom, Avishai [email protected] אבישי גוֹר -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
