× 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.



I'd use Jeff's method, but I'd use qsort() rather than SORTA and toggle a global variable to tell the callback procedure whether to sort in ASC/DSC sequence...

--- Original Message ---
From:"Jerry Adams" <Jerry@xxxxxxxxxxxxxxx>
Sent:Wed 10/22/08 8:22 am
To:"RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Subj:RE: Sorting arrays

That's pretty much the way that I do it. However, part of Booth's requirement was to sort ascending OR descending. SORTA sorts the array based upon the array's definition in the D-specs. So it would seem that, as records are retrieved from the table, they would have to be loaded into two arrays, and then sort the one that means the ASC/DSC criteria and load the subfile from there. Loading the second array shouldn't have a noticeable effect on response time.

Jerry C. Adams
IBM System i Programmer/Analyst
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.