sx_RYOKeyAdd

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_RYOKeyAdd

VB Declaration

Declare Function sx_RYOKeyAdd Lib "Apollo9.dll"

(ByVal cpTagname As String,  

ByVal cpKey As String)  

As Integer

C Declaration

BOOL FAR PASCAL sx_RYOKeyAdd

(BYTEP cpTagname,  

BYTEP cpKey);

Description

Adds a key to an existing sxChar RYO index tag that points to the current table record. Any existing key for the record is dropped. SxChar RYO indexes are limited to the FoxPro (SDEFOX) and HiPer-SIx (SDENSX) drivers.

Parameters

cpTagName: The name of the index tag containing the sxChar index. If passed as NULL, the current tag is used.

cpKey: A character string of the defined sxChar length.

Return Value

True or False depending on the outcome of the operation.

VB Example

' Create an RYO index tag that accepts any 3-byte key value

i = sx_Use( "C:\DATA\TEST.DBF", "TEST", EXCLUSIVE, SDEFOX )

sx_IndexTag( "", "CUST_CODE", "sxChar(3)", IDX_EMPTY, False, "" )

sx_SetOrder( 0 )

sx_GoTop

 

' Add a key for the current record  

If sx_RYOKeyAdd( "CUST_CODE", "VIP" ) Then

MsgBox "VIP Customer Code Key added successfully."  

Else

MsgBox "Key add failed!"  

End If

C Example

// Create an RYO index tag that accepts any 3-byte key value

i = sx_Use( "C:\\DATA\\TEST.DBF", "TEST", EXCLUSIVE, SDEFOX );

sx_IndexTag( NULL, "CUST_CODE", "sxChar(3)", IDX_EMPTY, FALSE, NULL );

sx_SetOrder( 0 );

sx_GoTop();

 

// Add a key for the current record  

if (sx_RYOKeyAdd( "CUST_CODE", "VIP" ))

AfxMessageBox ("VIP Customer Code Key added successfully.");

else

AfxMessageBox("Key add failed!" );

See Also

sx_RYOKeyDrop, sx_KeyAdd, sxChar xBase function