Logo

Programming-Idioms

History of Idiom 100 > diff from v19 to v20

Edit summary for version 20 by :
New Pascal implementation by user [JPSII]

Version 19

2016-02-18, 19:14:09

Version 20

2016-03-20, 23:28:12

Idiom #100 Sort by a comparator

Sort elements of array-like collection items, using a comparator c.

Idiom #100 Sort by a comparator

Sort elements of array-like collection items, using a comparator c.

Imports
uses classes;
Code
with TList.Create do try
  Sort(c);
finally
  Free;
end;�
Comments bubble
c must be of type function (Item1, Item2: Pointer): Integer;�