Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sorting routines in delphi2.

2 views
Skip to first unread message

Dane

unread,
Mar 17, 1997, 3:00:00 AM3/17/97
to

Hi all,
Is there anyone out there that would be able to help me with a sorting
routine.

A little more information about what I need to sort!

1. Using the type of the file as a packed record.
2. there are about 12000 records
3. it is a database with suburbs, postcodes and states in it.
4. also need code to remove duplicates
5. it needs to be sort by 1 postcodes and 2 suburbs. (there are 2
instances of the Database)

If there is anyone that could help me or give me some code to do this,
it would be greatly appreciated.

Kindest Regards,
Dane.


---------------------------------
Anything written is my opinion, not the opinion of the company
Enigma Software
PO Box 118
Umina 2257
NSW Australia
Email : bru...@hemlock.newcastle.edu.au

Ray Lischner

unread,
Mar 17, 1997, 3:00:00 AM3/17/97
to

On Mon, 17 Mar 1997 18:03:39 +1000, Dane
<bru...@hemlock.newcastle.edu.au> wrote:

> Is there anyone out there that would be able to help me with a sorting
>routine.

Read your records into a TList. Call Sort.

--
Ray Lischner, Tempest Software, Inc., Corvallis, Oregon, USA
Author of Secrets of Delphi 2 (http://www.tempest-sw.com/secrets/)

Jay Cole

unread,
Mar 17, 1997, 3:00:00 AM3/17/97
to

Dane <bru...@hemlock.newcastle.edu.au> wrote:

>Hi all,

> Is there anyone out there that would be able to help me with a sorting
>routine.

>A little more information about what I need to sort!

>1. Using the type of the file as a packed record.
>2. there are about 12000 records
>3. it is a database with suburbs, postcodes and states in it.
>4. also need code to remove duplicates
>5. it needs to be sort by 1 postcodes and 2 suburbs. (there are 2
>instances of the Database)
>
>If there is anyone that could help me or give me some code to do this,
>it would be greatly appreciated.


Hi Dane,

You could take a look at www.nitrosort.com. It should sort those
records from disk, to disk in less than a few seconds. (Depending on
the record length, it could be well under a second.) It retails for
$199 for the Delphi 2.0 version under Windows 95 and NT.

Jay Cole
==========
NitroSort, mainframe file sort performance at PC prices, see
www.nitrosort.com.


Jeffrey Schrab

unread,
Mar 18, 1997, 3:00:00 AM3/18/97
to

Issue #9 - November 9th, 1995 of the Unofficial Newsletter for Delphi Users
(UNDU) had a QuickSort component that should do the trick for ANY size of
data to be sorted. And it's free. It is VERY much like the Sort routine
in the Database Toolbox for Turbo Pascal ... Circa 1984...

Check:
http://www.informant.com/undu/index.htm

Dane <bru...@hemlock.newcastle.edu.au> wrote in article
<332CFA...@hemlock.newcastle.edu.au>...


| Hi all,
| Is there anyone out there that would be able to help me with a sorting
| routine.
|
| A little more information about what I need to sort!
|
| 1. Using the type of the file as a packed record.
| 2. there are about 12000 records
| 3. it is a database with suburbs, postcodes and states in it.
| 4. also need code to remove duplicates
| 5. it needs to be sort by 1 postcodes and 2 suburbs. (there are 2
| instances of the Database)
|
| If there is anyone that could help me or give me some code to do this,
| it would be greatly appreciated.
|

Efim Shvartsburg

unread,
Mar 19, 1997, 3:00:00 AM3/19/97
to li...@tempest-sw.com

Ray Lischner wrote:
>
> On Mon, 17 Mar 1997 18:03:39 +1000, Dane
> <bru...@hemlock.newcastle.edu.au> wrote:
>
> > Is there anyone out there that would be able to help me with a sorting
> >routine.
>
> Read your records into a TList. Call Sort.
>
> --
> Ray Lischner, Tempest Software, Inc., Corvallis, Oregon, USA
> Author of Secrets of Delphi 2 (http://www.tempest-sw.com/secrets/)

Unfortunately I did not get around my stupidity with this problem,
especially with
TListSortCompare = function (Item1, Item2: Pointer): Integer;

Even <Secrets of Delphi 2 > did not help.

Any help would be highly appreciated.

Cheers,

Efim


======================================================================
It's not the data themselves, it's what you do with them that matters.
======================================================================

Ray Lischner

unread,
Mar 19, 1997, 3:00:00 AM3/19/97
to

On Wed, 19 Mar 1997 10:10:19 -0500, Efim Shvartsburg
<ef...@concentric.net> wrote:

>Unfortunately I did not get around my stupidity with this problem,
>especially with
>TListSortCompare = function (Item1, Item2: Pointer): Integer;

Read data from a file, allocating a new record in your program for
each record you read from the file. Add a pointer to the record to a
TList. The list comparison routine takes two pointers as arguments.
Cast the pointers to pointers to your record type. Compare the
records. Return <0, 0, or >0, depending on the order of the records
(a<b, a=b, a>b).

Joel Jean

unread,
Mar 19, 1997, 3:00:00 AM3/19/97
to

Efim Shvartsburg <ef...@concentric.net> wrote in article
<333001...@concentric.net>...

> Ray Lischner wrote:
> >
> > On Mon, 17 Mar 1997 18:03:39 +1000, Dane
> > <bru...@hemlock.newcastle.edu.au> wrote:
> >
> > > Is there anyone out there that would be able to help me with a
sorting
> > >routine.
> >
> > Read your records into a TList. Call Sort.
> >
> > --
> > Ray Lischner, Tempest Software, Inc., Corvallis, Oregon, USA
> > Author of Secrets of Delphi 2 (http://www.tempest-sw.com/secrets/)
>
> Unfortunately I did not get around my stupidity with this problem,
> especially with
> TListSortCompare = function (Item1, Item2: Pointer): Integer;
>
> Even <Secrets of Delphi 2 > did not help.
>
> Any help would be highly appreciated.
>
> Cheers,
>
> Efim
>
>
> ======================================================================
> It's not the data themselves, it's what you do with them that matters.
> ======================================================================
>

Hi,

I had to use a sorting routine witch I found in the Threads example. There
is three examples Bubble Sort, Selection Sort and Quick Sort.

Hope this help.

--
----------------------------------------
Joel Jean
Programmeur / Analyste
CCNB - Bathurst
je...@gov.nb.ca
je...@nbnet.nb.ca
----------------------------------------

Bill Florac

unread,
Apr 3, 1997, 3:00:00 AM4/3/97
to

On Mon, 17 Mar 1997 17:41:43 GMT, li...@tempest-sw.com (Ray Lischner)
wrote:

>On Mon, 17 Mar 1997 18:03:39 +1000, Dane
><bru...@hemlock.newcastle.edu.au> wrote:
>
>> Is there anyone out there that would be able to help me with a sorting
>>routine.
>
>Read your records into a TList. Call Sort.
>
>--
>Ray Lischner, Tempest Software, Inc., Corvallis, Oregon, USA
>Author of Secrets of Delphi 2 (http://www.tempest-sw.com/secrets/)

I have put examples of this for D1 and D2 on my home page at
http://sumac.etcconnect.com/fitco

-------------------------------------
Bill Florac
Fitco
http://sumac.connect.com/fitco
e-mail: fl...@etcconnect.com*
(remove * tp reply)
-------------------------------------

0 new messages