Logo

Programming-Idioms

History of Idiom 100 > diff from v31 to v32

Edit summary for version 32 by programming-idioms.org:
[Pascal] Comment emphasis

Version 31

2016-12-11, 20:38:44

Version 32

2016-12-11, 21:29:26

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;
Imports
uses classes;
Code
with TList.Create do try
  Sort(c);
finally
  Free;
end;
Code
with TList.Create do try
  Sort(c);
finally
  Free;
end;
Comments bubble
c must be of type function _(Item1, Item2: Pointer): Integer;
Comments bubble
c must be of type function (Item1, Item2: Pointer): Integer;