Solved

Elist error index out of range

Posted on 2003-10-24
4
434 Views
Last Modified: 2010-08-05
Hi,

    i have a problem with a listbox that has the property multiple select set to
    true and sort set to true. coz everytime i have to remove multiple items or
    one item it will display an error elist errot. can you help me?
0
Comment
Question by:therooster
[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 27

Accepted Solution

by:
kretzschmar earned 250 total points
ID: 9612966
remove from behind to front like

for i := listbox1.items.count - 1 downto 0 do
  if listbox1.items[i].selected then
     listbox1.items.delete(i);

meikl ;-)
0
 
LVL 17

Expert Comment

by:geobul
ID: 9613320
Exactly. Just a little correction:

for i := listbox1.items.count - 1 downto 0 do
  if listbox1.selected[i] then
     listbox1.items.delete(i);

If this answers your question then accept kretzschmar's comment as answer !!!

Regards, Geo
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9613386
thanks for the correction, geo,
usual it was just from head,
as often as last time

meikl ;-)
0
 
LVL 17

Expert Comment

by:geobul
ID: 9613423
No problem, meikl :-)
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
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