?
Solved

ListBox sorting

Posted on 1998-06-23
1
Medium Priority
?
359 Views
Last Modified: 2010-04-04
I need a ListBox that is sorted by third character of Items, not by first. Any way to obtain this?
0
Comment
Question by:bor061297
[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
1 Comment
 
LVL 2

Accepted Solution

by:
kjteng earned 200 total points
ID: 1355485
The following is a procedure to sort from n-thcharacter of item:

procedure mySort( lb: tListBox; n: integer);
var i: longint;  s: string;
begin
  with lb do begin
    sorted:= false;
    for i:= 0 to items.Count-1 do begin
      s:= items[ i];
      items[ i]:= copy( s, n, length(s))+ copy( s, 1, n-1);
    end; {for}
    sorted:= true;
    sorted:= false;
    for i:= 0 to items.Count-1 do begin
      s:= items[ i];
      items[ i]:= copy( s, length( s)-n+2, length(s))
                  + copy( s, 1, length(s)-n+1);
    end; {for}
  end; {with}
end;

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

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