También puedes usar un TDictionary o crear tu propio objeto basado en este.
Código Delphi
[-]
type
TListaObjetos = class(TDictionary<String,Tobject>)
public
function Conteo: string;
end;
function TListaObjetos.Conteo: string;
begin
Result := Format('Tengo %d elementos', [Self.Count]);
end;
procedure TForm1.ListarObjetos(Sender: TObject);
const
Nombres : Array [0..7] of string = ('Obj1', 'Obj2', 'Obj3', 'Obj1', 'Obj4', 'Obj2', 'Obj5', 'Obj1');
var
i: integer;
ListaObjetos: TListaObjetos;
Nombre: string;
begin
ListaObjetos := TListaObjetos.Create;
try
for i := Low(Nombres) to High(Nombres) do
begin
Nombre := Nombres[i].Trim;
if Nombre.IsEmpty or ListaObjetos.ContainsKey(Nombre.ToUpper) then
Continue;
ListaObjetos.Add(Nombre.ToUpper, TObject.Create);
end;
ShowMessage(ListaObjetos.Conteo);
finally
ListaObjetos.Free;
end;
end;