× 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 Wed, 2004-06-30 at 18:42, CarollaT@xxxxxxxxxxxxxx wrote:
> I am having a problem with the %Lookup BIF.  I am performing a %Lookup on an
> array that has the value in it (I have debugged), and yet the %Lookup does
> not produce the index number of the array element.  
> 
> The array is very simple:
> D SiteCursor      S              3A   Inz(*Blanks)
> D                                     Dim(300)    
> D                                     Ascend 

Try it without ascend.  

>From the RPG Reference:

"Ascending sequence means that the array or table entries must start
with the lowest data entry (according to the collating sequence) and go
to the highest. Items with equal value are allowed."

I suspect that when you tell RPG that the data is already sorted, it
believes you.  The search algorithm probably uses some kind of binary
search when you call for the ASCEND keyword, versus an exhaustive search
when you don't.

--
Regards,
Rich

Current Conditions in Des Moines, IA
Broken Clouds
Temp 73.4F
Winds out of the Southeast at 6mph


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.