/*
Sort example
The following code sorts the objects in a list in alphabetical order based on their names. It assumes that the list contains only component references.
The CompareNames function performs the comparisons between objects in the list. The list is sorted when the user clicks a button.
*/ 
int __fastcall CompareNames(void *Item1, void *Item2)
{
  return CompareText(((TComponent *)Item1)->Name, ((TComponent *)Item2)->Name);
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  List1->Sort(CompareText);
} 
