/*
Remove, MessageDlg example
The following code adds a new object to a list in a list object and then removes it:
*/ 
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  TList *pList = new TList();
  AnsiString TheObject = "This is an object."
  try
  {
    pList->Add(TheObject); // add AnsiString instance to list
    MessageDlg("The list has " + IntToStr(pList->Count) + "objects", 
               mtInformation, TMsgDlgButtons() << mbOKmbOk, 0);
    pList->Remove(TheObject);
    MessageDlg("The list has " + IntToStr(pList->Count) + "objects", 
               mtInformation, TMsgDlgButtons() << mbOKmbOk, 0);
  }
  __finally
  {
    delete pList;
  }
} 
