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



Yes. So that would be relevant if David were using %TLOOKUPxx. But he's
not. He's using the %TLOOKUP, which does not use binary search.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"A fanatic is one who can't change his mind and won't change the subject."
-- Winston Churchill


It looks to me like %TLOOKUPxx uses a binary search, as %lookupxx does.

"Since a binary search is used by the %LOOKUPxx built-in functions for
a
sequenced array, and the correct function of a binary search depends on
the data being in order, the search may only look at a few elements of
the array. When the array is out of order, the result of a binary
search
is unpredictable. "


On 12/16/2010 10:23 AM, Dennis Lovelady wrote:
The manual refers to both kinds of lookups. The kind that David is
using is
not of the %TLOOKUPxx set, the nearest I can determine. The %TLOOKUP
BIF
works by comparing each value starting with 1 and ending when a match
is
found or the end of the table is reached. Sequence is immaterial.
Or at
least that's the way it was the first 35 years or so of the language.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"A diplomat is a person who can tell you to go to hell in such a way
that
you actually look forward to the trip."
-- Caskie Stinnett

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.