Found
Found() --> lRetChecks the last seek result.
Overview
Found reports the last seek outcome without performing another lookup or proving cursor validity for every later read. The example requires an active order whose expression is length-10 ED_COD and seeks fictional key A padded to that length. Found is checked immediately in the same context without an intervening seek. It neither searches a standard business table nor guarantees the key exists. EDTRB is an already-open owned test alias; ED_COD, when used, is a length-10 character field in the teaching schema. (TOTVS, n.d., ref. 1)
Syntax
Found() --> lRetReturn value
Logical success of the last seek.
Commented example
#Include "Protheus.ch"
User Function Ed390()
Local lSeek
Local lLast
// Owned EDTRB; active length-10 ED_COD order.
If Select("EDTRB") > 0
lSeek := EDTRB->(DBSeek(PadR("A",10), .F.))
lLast := EDTRB->(Found())
ConOut(cValToChar(lSeek))
ConOut(cValToChar(lLast))
EndIf
Return NilTwo indicators for the just-completed seek, depending on data; alias position changes. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Use only an owned test table with known schema. Qualify the alias, check record position and manage context changes under the caller contract.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.