bsearch: Partial Key Searches and More
February 22, 2012 Jon Paris
Note: The code accompanying this article is available for download here. In bsearch: A Better %LOOKUP, I mentioned that bsearch permits us to do a partial key lookup (i.e., a lookup that is based on just a portion of the search field). Since bsearch performs a binary search, it will not necessarily return the first matching element in the array. If we need to handle all matching elements then we have to be able to locate the first match in the array, and then process subsequent matching elements. Before we jump into the mechanics of how to do |