LastRec Function | |
Return the number of the last record in a database file.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION LastRec() AS DWORD
public static uint LastRec()
Request Example
View SourceReturn Value
Type:
DWord
The number of physical records in a database file. Filtering or deleted settings have no effect on the return value. LastRec() returns 0 if there is no database file in use.
Remarks
By default, this function operates on the currently selected work area.
It can be made to operate on an unselected work area by specifying
it within an aliased expression or by calling the overload that accepts a workarea
parameter (a workarea number or alias ).
Examples
This example illustrates the relationship between LastRec(), RecCount(), and COUNT:
1USE sales NEW
2QOut(LastRec(), RecCount())
3
4SET FILTER TO Salesman = "1001"
5COUNT TO nRecords
6QOut(nRecords, LastRec())
This example uses an aliased expression to access the number of records in a open database file in an unselected work area:
1USE sales NEW
2USE customer NEW
3QOut(LastRec(), Sales->LastRec())
See Also