Click or drag to resize

DbServer.SetIndex Method (FileSpec)

X#
Open an index file and select its order as the controlling order, if this is the first index being opened.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.21
Syntax
 VIRTUAL METHOD SetIndex(
	oFSIndex AS FileSpec
) AS LOGIC
Request Example View Source

Parameters

oFSIndex
Type: FileSpec
A string or filespec object that specifies the index file. File type defaults to the native type for the driver (RDD).

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
Remarks
Sends a NotifyIntentToMove message before the operation.
Sends a NotifyFileChange message, if successful.
If the index file contains more than one order, the first one is set as the controlling order. The server is positioned to the first logical record in the controlling order.
Examples
The following example opens multiple index files:
X#
1oSales := DBServer{"sales"}
2oSales:SetIndex("firstname")
3oSales:SetIndex("lastname")
4IF oSales:Seek(cLast)
5IF oSales:Deleted() .AND. RLock()
6oSales:Recall()
7ENDIF
8ENDIF
See Also