Click or drag to resize

OrdKeyGoto Function

Move to a record specified by its logical record number in the controlling order.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax
 FUNCTION OrdKeyGoto(
	 nKeyNo AS USUAL
) AS LOGIC
View Source

Parameters

nKeyNo
Type: Usual
The logical record number.  If the value specified does not satisfy the scope or for condition for the order, the record pointer is positioned at the end-of-file.

Return Value

Type: Boolean
TRUE if successful; otherwise, FALSE.
Remarks
OrdKeyGoTo() is the complement to OrdKeyNo().  OrdKeyNo() returns the logical record number (i.e., its position in the controlling order) of the current record, and OrdKeyGoTo() moves the record pointer to the specified logical record. Tip:  This function can be useful when displaying scroll bars.  If the user clicks on a certain position on the scroll bar, you can move to the corresponding record by calling OrdKeyGoTo(). 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
Examples
This example shows the difference between physical and logical record number:
X#
USE customer
SET INDEX TO first                        // Make records in first name
                                                // order
OrdKeyGoTo(100)                                // Go to the 100th logical record
? RECNO()                                        // Returns the physical record
                                                // number
? OrdKeyNo()                                // Returns 100, the logical
                                                // record no
See Also