[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
LASTREC()
Determine the number of records in the current (.dbf) file
------------------------------------------------------------------------------
Syntax
LASTREC() | RECCOUNT()* --> nRecords
Returns
LASTREC() returns the number of physical records in the current database
file as an integer numeric value. Filtering commands such as SET FILTER
or SET DELETED have no effect on the return value. LASTREC() returns
zero if there is no database file in USE in the current work area.
Description
LASTREC() is a database function that determines the number of physical
records in the current database file. LASTREC() is identical to
RECCOUNT() which is supplied as a compatibility function.
By default, LASTREC() operates on the currently selected work area. It
will operate on an unselected work area if you specify it as part of an
aliased expression (see example below).
Examples
. This example illustrates the relationship between LASTREC(),
RECCOUNT(), and COUNT:
USE Sales NEW
? LASTREC(), RECCOUNT() // Result: 84 84
//
SET FILTER TO Salesman = "1001"
COUNT TO nRecords
? nRecords, LASTREC() // Result: 14 84
. This example uses an aliased expression to access the number
of records in a open database file in an unselected work area:
USE Sales NEW
USE Customer NEW
? LASTREC(), Sales->(LASTREC())
Files: Library is CLIPPER.LIB.
See Also:
COUNT
EOF()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson