• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

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