Solved

Search and Remove from ListBox

Posted on 2007-11-19
4
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
MerijnB earned 500 total points
ID: 20312167
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
ID: 20312211
Strange: I get an error Undeleared Identifier DELETE
0
 

Author Comment

by:ST3VO
ID: 20312250
ListBox1.items.Delete(i); works!

Thanks a lot :o)

0
 
LVL 19

Expert Comment

by:MerijnB
ID: 20312315
sorry, that was a typo :|
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Create Database on Android via Delphi dbExpress 3 129
scroll down TListBox component in Delphi 1 31
DBCtrlGrid, Delphi, Scroll 7 32
delphi popmenu non latine charcters 3 33
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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