• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

Search and Remove from ListBox

Hi all,

I have a listbox with a list of items.

Some lines in the listbox have the word "NULL"

I need to get rid of any of this but I don't want to take it off and leave a blank line.

I need to search all items with "NULL" and Take them off but NOT leave a blank line either.

Is this possible please?

Thanks

ST3VO
0
ST3VO
Asked:
ST3VO
  • 2
  • 2
1 Solution
 
MerijnBSr. Software EngineerCommented:
see this example
var i: integer;
begin
 for i := ListBox1.Items.Count - 1 downto 0 do
  if ListBox1.Items[i] = 'NULL' then
   ListBox1.Delete(i);
end;

Open in new window

0
 
ST3VOAuthor Commented:
Strange: I get an error Undeleared Identifier DELETE
0
 
ST3VOAuthor Commented:
ListBox1.items.Delete(i); works!

Thanks a lot :o)

0
 
MerijnBSr. Software EngineerCommented:
sorry, that was a typo :|
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now