Solved

Search and Remove from ListBox

Posted on 2007-11-19
4
176 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

Technology Partners: 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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

726 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