xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

LastRec()

Returns the number of records available in a work area.

Syntax

LastRec() --> nRecords

Return

The function returns the number of records available in a work area as a numeric value. If the work area is not used or if a database is empty, the return value is zero.

Description

The LastRec() function returns the number of records available in a work area. It is the actual number of physical records stored in a database file, not the number of records that a logically visible in a work area.

Logical visibility of records can be reduced with SET FILTER, SET DELETED or SET SCOPE so that the number of records that are accessible during database navigation can be less than the number of records reported by LastRec().

Info

See also:COUNT, Eof(), OrdKeyCount(), RecCount(), RecNo()
Category: Database functions
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example illustrates LastRec() usage with and without
// alias operator

   PROCEDURE Main
      USE Customer  ALIAS Cust NEW
      USE Invoice   ALIAS Inv  NEW

      ? Alias()                 // result: INV
      ? LastRec()               // result: 12233
      ? Cust->(LastRec())       // result: 5612

      CLOSE ALL
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe