× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 2019-12-12 6:47 p.m., mlazarus wrote:
Barbara,

 Good point.  I had overlooked the varchar in the definition, as the OP seemed to be more concerned about how to sort a corresponding array based on more than one field.

 If varchar was removed, would that technique sort properly by name and manager?


Yes, I think so. Except that I think Booth wanted to sort by Manager then Name, so the subfields would have to be reversed.

But I wouldn't use this technique, since it only works with such a restricted set of data types. Or if I did, I'd add comments all over the place warning other programmers (and the future me) against changing the subfields to be varying length.

Even though qsort() seems like a pain, having to define another procedure to do the comparison, it's straightforward once you know how.

I don't think anyone has posted a link to a qsort how-to yet in this thread. Here's one that Jon Paris wrote:
https://www.itjungle.com/2012/01/25/fhg012512-story02/


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.