<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_RYOKeyDrop |
Declare Function sx_RYOKeyDrop Lib "Apollo9.dll"
(ByVal cpTagname As String)
As Integer
BOOL FAR PASCAL sx_RYOKeyDrop
(BYTEP cpTagname);
Drops a key from an existing sxChar RYO index tag that points to the current table record.
cpTagName: The name of the index tag containing the sxChar index. If passed as NULL, the current tag is used.
True or False depending on the outcome of the operation.
' Create an RYO index tag that accepts any 3-byte key value
i = sx_Use( "C:\DATA\TEST.DBF", "TEST", EXCLUSIVE, SDEFOX )
j = sx_IndexTag( "", "CUST_CODE", "sxChar(3)", IDX_EMPTY, False, "" )
sx_SetOrder( j )
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
' Drop the key for the current record
If sx_RYOKeyDrop( "CUST_CODE" ) Then
MsgBox "Key removed successfully."
Else
MsgBox "Key drop failed!"
End If
// Create an RYO index tag that accepts any 3-byte key value
i = sx_Use( "C:\\DATA\\TEST.DBF", "TEST", EXCLUSIVE, SDEFOX );
j = sx_IndexTag( NULL, "CUST_CODE", "sxChar(3)", IDX_EMPTY, FALSE, NULL );
sx_SetOrder( j );
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!" );
// Drop the key for the current record
if (sx_RYOKeyDrop( "CUST_CODE" ))
AfxMessageBox( "Key removed successfully." );
else
AfxMessageBox ("Key drop failed!");