var
MyList: TStringList;
Index: Integer;
begin
MyList := TStringList.Create;
try
MyList.Add('Animals');
MyList.Add('Flowers');
MyList.Add('Cars');
MyList.Sort; { Find will only work on sorted lists! }
if MyList.Find('Flowers', Index) then
begin
ListBox1.Items.AddStrings(MyList);
Label1.Caption := 'Flowers has an index value of ' + IntToStr(Index);
end;
finally
MyList.Free;
end;
end;