Contact::SwapKey (Interface: Contact)
 
Swaps the file to another key.
 
VARIANT_BOOL SwapKey (
    SHORT sKeyNum
)
 
Parameters
sKeyNum
[in] The number of the key by which you want the file positioned.
 
Return value
True if the file was positioned according to the given key, otherwise false (e.g. if the current record is a null value for the given key or if an invalid sKeyNum was supplied).
 
See Also
CreateContact
Browse
GetDBStatus
GetNext
The possible keys (and their numerical value) can be found in the SeekBy-methods of this interface.
 
Samples
 
C++
 
// Browse for a contact, which positions the file by a key that is unknown
pContact->Browse (VARIANT_FALSE);
// Swap the key to 'CTC_NAM' (2), positioning by name and first name
pContact->SwapKey (2);
// Navigate through the file using the key 'CTC_NAM'
while (pContact->GetDBStatus () == 0)
{
    // Process record data
    
    pContact->GetNext ();
}

C#
 
// Browse for a contact, which positions the file by a key that is unknown
oContact.Browse (false);
// Swap the key to 'CTC_NAM' (2), positioning by name and first name
oContact.SwapKey (2);
// Navigate through the file using the key 'CTC_NAM'
while (oContact.GetDBStatus () == 0)
{
    // Process record data
    
    oContact.GetNext ();
}

VBS
 
' Browse for a contact, which positions the file by a key that is unknown
Call oContact.Browse(False)
' Swap the key to 'CTC_NAM' (2), positioning by name and first name
Call oContact.SwapKey(2)
' Navigate through the file using the key 'CTC_NAM'
While oContact.GetDBStatus() = 0
    ' Process record data
    
    Call oContact.GetNext()
Wend

VB.NET
 
' Browse for a contact, which positions the file by a key that is unknown
oContact.Browse(False)
' Swap the key to 'CTC_NAM' (2), positioning by name and first name
oContact.SwapKey(2)
' Navigate through the file using the key 'CTC_NAM'
While oContact.GetDBStatus() = 0
    ' Process record data
    
    oContact.GetNext()
End While