Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Elist error index out of range

Posted on 2003-10-24
4
Medium Priority
?
453 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
  • 2
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 1000 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

879 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