xHarbour Reference Documentation > Function Reference |
Returns the number of records available in a work area.
LastRec() --> nRecords
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.
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().
See also: | COUNT, Eof(), OrdKeyCount(), RecCount(), RecNo() |
Category: | Database functions |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// 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
http://www.xHarbour.com