{
Remove example
The following code adds a new object to a list in a list object and then removes it:
} 
type
  TMyClass = class
    MyString: string;
    constructor Create(S: string);
  end;
constructor TMyClass.Create(S: string);
begin
  MyString := S;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
  MyList: TList;
  MyObject: TMyClass;
begin
  MyList := TList.Create;        { create the list }
  try
    MyObject := TMyClass.Create('Semper Fidelis!');  { create a class instance }
    try
      MyList.Add(MyObject);      { add instance to list }
      MessageDlg('The list has ' + IntToStr(MyList.Count) + 'objects', 
                 mtInformation, [mbOk], 0);
      MyList.Remove(MyObject);
      MessageDlg('The list has ' + IntToStr(MyList.Count) + 'objects', 
                 mtInformation, [mbOk], 0);
    finally
      MyObject.Free;
    end;                  { don't forget to clean up! }
  finally
    MyList.Free;
  end;
end; 
