× 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 2015-01-16 01:31, Booth Martin wrote:
At V5R3 I would probably do this:
D X 2 0
D EarnTypeS 3 Dim(50)
D HoursSum 12 2 Dim(50)
D PaySum 12 2 Dim(50)
...
C EarnTypeL Lookup EarnTypeS(x) 30
and then use arrays HoursSum(x) and PaySum(x)


Better to code it so that the arrays are coded as overlays to another array. That way, it's clear that all the arrays are related, and as a bonus, if you sort any one of the overlaying arrays, they will all stay in synch.

D Info Dim(50)
D EarnTypeS 3 Overlay(Info)
D HoursSum 12 2 Overlay(Info:*next)
D PaySum 12 2 Overlay(Info:*next)

You can use the same LOOKUP as in your example.

C EarnTypeL Lookup EarnTypeS(x) 30

If you do this, sorting by one of the arrays:
C Sorta PaySum

then using the overlay mechanism, it will sort the Info array using PaySum as a key. But with the three separate arrays in your example, it would just sort the PaySum array, and the EarnTypes and HoursSum arrays would still be in their original order, so the three arrays would be out of synch.


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.