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



Hi, again, Kurt:

There may be a way to do just what you want ...to search a data-structure array by a "key" field ... by using ILE C/400 runtime routines qsort and bsearch (binary search), instead ofusing the RPG %lookup BIF ...

See:
http://www.think400.dk/adhoc_4.htm

On that web page, page down just a little way to find the section "C runtime function - bsearch & qsort" ... it even includes example code that appears to be pretty close to what you are looking for ... *;-)*

Hope this helps,

Mark S. Waterbury

> On 11/11/2011 9:52 AM, Kurt Anderson wrote:
John,

...(snip)...
I don't mean to be confusing. I guess I opened up the world when I said, "or is there a better idea?" I really only wanted to whine about the lack of complete functionality of data structure arrays. That is to say, I'm a huge fan and use data structure arrays a lot now, but it's a bummer that I can't use the binary search functionality of %lookup with them. I was really hoping someone would say, "Oh, what you need to do to get that to work is [this]" and I would slap my head and say "D'oh!" Unfortunately that doesn't seem to be the case in this situation.

-Kurt


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.