RECCOUNT()
RecCount()Explains a legacy function superseded by LastRec.
Overview
Current LastRec documentation marks RecCount and RecC obsolete. The contract concerns the last physical record, not a count of visible or undeleted rows. Do not use it as a business key or a filtered-query total. This uninvoked example shows the documented replacement. The documentation warns that pending changes may be flushed; avoid calling during a partially populated insert. (Sources: refs. 1–1.)
Syntax
RecCount()Return value
Numeric in legacy use; check RDD behavior.
Commented example
#Include "Protheus.ch"
User Function Ed612()
// Requires an open real-table area; block not invoked.
Local bLast := {|| LastRec()}
ConOut(ValType(bLast))
Return NilOnly creates block B; no actual records counted. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Use COUNT(*) with correct filters for logical row counts; distinguish LastRec from Recno.
- 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.