Click or drag to resize

OrdKeyGoto Function

X#
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.19
Syntax
 FUNCTION OrdKeyGoto(
	nKeyNo
) AS LOGIC CLIPPER
Request Example View Source

Parameters

nKeyNo (Optional)
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: Logic
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#
1USE customer
2SET INDEX TO first            // Make records in first name
3                        // order
4OrdKeyGoTo(100)                // Go to the 100th logical record
5? RECNO()                    // Returns the physical record
6                        // number
7? OrdKeyNo()                // Returns 100, the logical
8                        // record no
See Also