Click or drag to resize

DbServer.RecNo Property (Typed)

X#
A numeric value representing the current record number, identifying the position of the record pointer.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.19
Syntax
 VIRTUAL PROPERTY RecNo AS LONG GET SET 
Request Example View Source

Property Value

Type: Long
A numeric value representing the current record number, identifying the position of the record pointer.
Remarks
A numeric value representing the current record number, identifying the position of the record pointer. Assigning a value to RecNo is equivalent to executing GoTo(); both reposition the record pointer on the given record. These two statements are equivalent:
X#
1oDBServer:RecNo := 1168
2oDBServer:GoTo(1168)
If the server contains a database file with 0 records, RecNo returns 1, BOF and EOF both return TRUE, and RecCount/LastRec return 0. If the record pointer is moved past the last record, RecNo returns LastRec + 1 and EOF returns TRUE. If an attempt is made to move before the first record, RecNo returns the record number of the first logical record in the database file and BOF returns TRUE. The DBServer:RecNo assign sends a NotifyIntentToMove message before the operation.
Examples
This example queries RecNo after deliberately moving the record pointer:
X#
 1CLASS Sales INHERIT DBServer
 2...
 3FUNCTION RecNoDemo()
 4LOCAL oDBSales AS Sales
 5oDBSales := Sales{}
 6oDBSales:GoTo(3)
 7? oDBSales:RECNO            // Result: 3
 8oDBSales:GoTop()
 9? oDBSales:RECNO            // Result: 1
10oDBSales:GoBottom()
11? oDBSales:RECNO            // Result: 10
See Also