sx_SetOrder

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_SetOrder

VB Declaration

Declare Function sx_SetOrder Lib "Apollo9.dll"

(ByVal iIndex As Integer)

As Integer

Description

Selects an existing order as the controlling index order.

 

When compound indexes are opened (either automatically as structural indexes or explicitly via sx_IndexOpen) there is no controlling order presumed. You must explicitly select an order with sx_SetOrder.

Parameters

iIndex: This is the integer identifier of the order attached to this work area that is returned by sx_IndexOpen, sx_IndexOrd, sx_Index, or sx_TagArea. When using NTX and IDX indexes, this value should be retained in a global variable to ensure your ability to switch to this order when required.

The current order identifier may be retrieved with sx_IndexOrd.

Note: If iIndex is passed as zero, all index orders are turned off and the table record sequence reverts to natural order.

Return Value

The previous index order identifier in use is returned. If zero, there was no previous index order in use.

VB Example

' open file and set order

Cust = sx_Use("c:\vb\sde\sxcust.dbf", "cust", READWRITE, SDENTX)

CustIndex1 = sx_IndexOpen("c:\vb\sde\sxcust1.ntx")

CustIndex2 = sx_IndexOpen("c:\vb\sde\sxcust2.ntx")

iRetVal = sx_SetOrder(CustIndex1)

See Also

sx_Index, sx_IndexOpen, sx_IndexOrd, sx_TagArea, sx_TagName