Possible new Sort option

A PocketC native palm library offering native forms and assorted utilities

Postby awschwab on Thu May 02, 2002 3:34 pm

The Sort function is fast and useful. One option that would be very nice would be the ability to sort an array of pointers by the values of the objects they point to. I can do that with a sort function written in PocketC, where I can define the compare function, but the advantage of a sorted array of pointers is speed. Would it be straightforward to add a bit to specify sorting by the dereferenced pointer?

I realize that adding every possible option does not make sense, but I thought that this would be useful in a variety of circumstances. (And I of course have a specific one in mind.)
awschwab
 
Posts: 270
Joined: Tue Feb 06, 2001 2:33 pm
Location: USA

Postby jstadolnik on Thu May 02, 2002 4:59 pm

This is feasible, and I agree could be useful... especially if null pointers in the sorted array get moved to the end (forward).

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby jstadolnik on Sat May 04, 2002 1:11 pm

I've implemented this. You'll see it in the next release.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 2 guests

cron