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




For the example that I've (which you mentioned that it could be elem 2,3
or,4), is there a pattern on which elem it will pick?

No, there's no way to tell which elem it'll pick. However, you can easily read the previous and next elements to determine where you are once it has picked one.

If this array is a physical file and I did a setll and then readp, I
would expect it to always pick elem 4.

What you've forgotten is that you've built an index over a key in your physical file. You haven't done that in the case of the array.

You could build an index over your array (using the User Index APIs) and use that to look up elements in the array in pretty much the same fashion as you would a physical file.

However, if you don't build an index over the array, it works like an unkeyed physical file (except, it's faster). You can look stuff up using a binary search algorithm (even if you have to write it yourself) and in many/most cases it'll actually be faster than a PF lookup, even though the PF lookup has an index built over it.

Arrays are marvelous things -- but they're not physical files.

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.