DBGoTop
DBGoTop() --> NilMoves to the first logical record.
Overview
DBGoTop moves to the first record under the active order and filter, not necessarily the corresponding physical position. It returns Nil; check EOF before reading fields. The demonstration changes its owned alias position and only reports whether an accessible record exists. EDTRB identifies only an owned test table already open with the required schema and permissions; examples are not intended for standard tables. (TOTVS, n.d., ref. 1)
Syntax
DBGoTop() --> NilReturn value
Nil; not a logical success indicator.
Commented example
#Include "Protheus.ch"
User Function Ed334()
// EDTRB belongs to this demonstration. Position will change.
If Select("EDTRB") > 0
EDTRB->(DBGoTop())
ConOut(cValToChar(!EDTRB->(Eof())))
EndIf
Return NilReports a visible record; depends on data and filter. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Check RDD, alias and pending operations. Navigation can flush updates; preserve context under the caller contract and handle errors in the complete routine.
- 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.