[fpc-pascal] sorting and merging array of records
Marco van de Voort
marcov at stack.nl
Tue Jan 10 21:31:32 CET 2012
In our previous episode, Tomas Hajny said:
> >> TSortedCollection (as provided in unit objects).
> >
> > The classes unit also has a TCollection, which can be sorted on any field
> > of
> > the collection items ?
>
> When looking at it, using or descending Classes.TCollection for simple
> data records seemed to be considerably more complex than with
> Objects.TSortedCollection (I studied our documentation and also searched
> on WWW for general Delphi examples). I even found an implementation of the
> TP/BP TSortedCollection for the Delphi model on the Web (based on Delphi
> classes) which kind of suggested that the original TP/BP objects could
> provide some additional value (by saving some effort necessary otherwise).
> Admittedly, it might easily be due to lack of my knowledge, but these were
> my results.
IIRC the problem with TP collections was that the forall operator used
hackery to call a nested procedure. With proper ISO procedure variable
support in 2.6.0 that could be done good :-)
More information about the fpc-pascal
mailing list