LastRec Function (Usual) | |
Return the number of the last record in a database file.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION LastRec(
uArea AS USUAL
) AS DWORD
public static uint LastRec(
Usual uArea
)
Request Example
View SourceParameters
- uArea
- Type: Usual
Specifies the work area name or number for a table from which the value must be retrieved.
Return 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