Hi Denis, Thanks for your reply.
On 9 May 2016 at 13:24, Denis Kozlov <dez...@gmail.com> wrote: > On 9 May 2016 at 12:48, Richard Mace <richard.m...@gmail.com> wrote: > >> I have a TObjectList that contains many objects that have a property >> called "Position" which is an integer. >> >> Could somebody show me an example of the code that I will need to create >> that will sort all of my Objects within the TObjectList so that they are in >> position order e.g. 1,2,3,4,5 and so on? >> > > Call TList.Sort method and supply a comparison function. > > > For example: > > List.Sort(@CompareByPositionPtr); > Would I call the List.sort externally, or would the List call sort when an Add has happened, as I don't seem to have a ".sort" method on my TObjectList? Thanks Richard
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus