Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

Recno

Recno() -> nRec

Reads the current physical record position.

RecnoAdvPL
01 · OVERVIEW

Overview

Recno identifies the current record in the selected alias; it is neither row count nor a stable key across tables, environments or restores. TDN documents a TOPCONN EOF sentinel and zero without an open area. Check Eof before using the value; positivity alone does not prove a valid record. The uninvoked block requires the caller’s alias. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

Recno() -> nRec

Return value

Numeric: current position according to RDD and state.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed614()
    // Caller must check Select(cAlias)>0 and !Eof().
    Local bRecord := {|cAlias| (cAlias)->(Recno())}
    ConOut(ValType(bRecord))
Return Nil
Expected result

Creates a block without reading a table in this exercise. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Qualify the alias and do not treat EOF sentinels as valid addresses.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Recno. TDN. Accessed on 2026-10-27.
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