Bof
Bof() --> lRetChecks the workarea beginning-of-file flag.
Overview
Bof checks the selected workarea or the alias used for evaluation. The official example runs DbGoTop followed by DbSkip(-1) to reach Bof: being on the first valid record alone does not establish this flag. Use it as a reverse-navigation boundary and account for empty tables and filters. The area must be open; do not alter or close a caller-owned alias merely to demonstrate it. (Refs. 1–2)
Syntax
Bof() --> lRetReturn value
Logical indicating the workarea beginning condition.
Commented example
// Diagnostic fragment: assumes caller has already opened SA1.
Local aArea := SA1->(GetArea())
SA1->(DbGoTop())
SA1->(DbSkip(-1))
ConOut(cValToChar(SA1->(Bof())))
// Restore the received position without closing SA1.
RestArea(aArea)On a navigable table, reproduces the official Bof condition. This diagnostic fragment requires an existing alias; it is not an opening routine. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Distinguish Bof from Eof and qualify the alias. For SQL queries, verify whether the RDD supports repositioning and backward navigation.
- 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.