/*
Add, AddStrings, Find example
This example uses a list box and a label on a form. When the application runs, a string list object is created and three strings are added to it. The Find method searches the strings to look for a match with the string ‘Flowers’. If the string is found, all the strings in the string list are added to the list box, and the index value of the ‘Flowers’ string appears in the caption of the label control.
*/ 
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  int Index;
  TStringList* MyList = new TStringList();
  try
    MyList->Add("Animals");
    MyList->Add("Flowers");
    MyList->Add("Ocean");
    MyList->Sort(); // Find will only work on sorted lists
    if (MyList->Find("Flowers", Index))
    {
      ListBox1->Items->AddStrings(MyList);
      Label1->Caption = "Flowers has an index value of " + AnsiString(Index);
    }
  __finally
  {
    delete MyList;
  }
} 
