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



qsort will repeatedly pass your procedure a pair of data strucures to
compare.  Your procedure just does the comparison of the two structures it
was passed.  I don't worry about what order that qsort compares elements
because I know when it is all done my MODS is sorted how I want :)

Scott Mildenberger

> -----Original Message-----
> From: Fisher, Don [mailto:Dfisher@roomstoreeast.com]
> Sent: Tuesday, November 12, 2002 12:33 PM
> To: 'rpg400-l@midrange.com'
> Subject: RE: Sorting a Multi-occurrence data structure
>
>
> Yes, I know, but how does QSORT determine which occurrences
> are passed to
> the RPG procedure for comparison?  Does it make any
> assumptions as to the
> position of the sort field?
>
> For example, say I have a data structure containing four
> fields with values
> as follows that I wish to sort by the third field:
> B 1 DD 5
> A 1 AA 6
> D 2 BB 4
> C 3 CC 2
>
> If I use QSORT, it will presumably send the first two
> occurrences back for
> comparison and my procedure will indicate occurrence one
> should come after
> occurrence two.  Would it then present the third occurrence
> for comparison
> with the first two?
>
> I would think so, but I'm not sure based on what I've read.
>


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.