Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

Eof

Eof() --> lRet

Checks whether navigation reached the end boundary.

EofAdvPL
01 · OVERVIEW

Overview

Eof returns a logical flag for the current alias. DBGoBottom positions on the last record but does not set EOF; moving past it can. An empty table already has true EOF. The example qualifies owned test table EDTRB, already open without pending changes, and only reports current state. EOF is not a record count, and fields must not be read when it is true. (TOTVS, n.d., ref. 1)

02 · SYNTAX

Syntax

Eof() --> lRet

Return value

Logical: true at the end boundary or on an empty table.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed364()
    // EDTRB is an already-open owned test table.
    If Select("EDTRB") > 0
        ConOut(cValToChar(EDTRB->(Eof())))
    EndIf
Return Nil
Expected result

State depends on position and data; no additional movement. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Qualify and verify the alias before querying.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Eof. TDN. Accessed on 2026-10-26.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha