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

I read through a file (in Key order, the key being the value that will fill
in the SiteCursor elements), and populate each element in the array with the
site ID value (3 Alpha).  I am also populating a similar element of a data
structure array, which will hold numerics.  

Once populated, I read through an accounts file, and for each record, I
%lookup the site ID in the SiteCursor array:

ElemNumber=%Lookup(Fmacro:SiteCursor);


I then use the ElemNumber index value to add up dollar amounts from the
accounts file, in the other data structure array:

Sitesum(ElemNumber).SumChgs += Fmcrch;


In debugging, for some reason, the %Lookup never works.  I have verified
that the array contains the element being looked up, but it fails to place
any value in the ElemNumber variable.  I know the values are in order in the
SiteCursor array, so I don't do a SortA, because this would sort all of the
blanks to the top.  Does a SortA need to be run for %Lookup to work?



Tony Carolla
MedAmerica Billing Services, Inc. 

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.