Solved

Search and Remove from ListBox

Posted on 2007-11-19
4
166 Views
Last Modified: 2010-04-05
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
Comment
Question by:ST3VO
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
MerijnB earned 500 total points
Comment Utility
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
 

Author Comment

by:ST3VO
Comment Utility
Strange: I get an error Undeleared Identifier DELETE
0
 

Author Comment

by:ST3VO
Comment Utility
ListBox1.items.Delete(i); works!

Thanks a lot :o)

0
 
LVL 19

Expert Comment

by:MerijnB
Comment Utility
sorry, that was a typo :|
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now