Venice
Entry::SwapKey
 
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
CreateEntry
Browse
GetDBStatus
GetNext
The possible keys (and their numerical value) can be found in the SeekBy-methods of this interface.
 
Samples
 
C++
 
// Browse for an entry, which positions the file by a key that is unknown
pEntry->Browse (VARIANT_FALSE);
// Swap the key to 'ENT_DOC' (3), positioning by document
pEntry->SwapKey (3);
// Navigate through the file using the key 'ENT_DOC'
while (pEntry->GetDBStatus () == 0)
{
    // Process record data
    
    pEntry->GetNext ();
}

C#
 
// Browse for an entry, which positions the file by a key that is unknown
oEntry.Browse (false);
// Swap the key to 'ENT_DOC' (3), positioning by document
oEntry.SwapKey (3);
// Navigate through the file using the key 'ENT_DOC'
while (oEntry.GetDBStatus () == 0)
{
    // Process record data
    
    oEntry.GetNext ();
}

VBS
 
' Browse for an entry, which positions the file by a key that is unknown
Call oEntry.Browse(False)
' Swap the key to 'ENT_DOC' (3), positioning by document
Call oEntry.SwapKey(3)
' Navigate through the file using the key 'ENT_DOC'
While oEntry.GetDBStatus() = 0
    ' Process record data
    
    Call oEntry.GetNext()
Wend

VB.NET
 
' Browse for an entry, which positions the file by a key that is unknown
oEntry.Browse(False)
' Swap the key to 'ENT_DOC' (3), positioning by document
oEntry.SwapKey(3)
' Navigate through the file using the key 'ENT_DOC'
While oEntry.GetDBStatus() = 0
    ' Process record data
    
    oEntry.GetNext()
End While