Link to home
Start Free TrialLog in
Avatar of alanjbrown
alanjbrown

asked on

Sorting Array of records with multiple sort keys

I need a function that will sort an array of records, using multiple keys, i.e. similar to using
ORDER BY customer_no, Inv_date, ord_number in SQL.

The number of records in the array will not be very large, probably only several hundred maximum.

Any guidance will be greatly appreciated.

Alan
Avatar of kretzschmar
kretzschmar
Flag of Germany image

you may use a tlist or tstringlist as your record-container,
rather than an array, then u can use the customsort capability
of this objects.

just ask if you need advice about this.

meikl ;-)
Avatar of alanjbrown
alanjbrown

ASKER

Meikl

I think that I need some additional help. In  Delphi help I can't find any reference to  customsort. Is this available in Delphi 4?
An example using  multiple keys would be useful.

Alan
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It will not compile. Get error Variants.dcu not found

Alan
hum, sorry,
just remove the variants part from the uses clause
(was introduced with delphi6)

meikl ;-)