PerPay::SwapKey (Interface: PerPay)
 
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
CreatePerPay
Browse
View
The possible keys (and their numerical value) can be found in the SeekBy-methods of this interface.
 
Samples
 
C++
 
// Browse for a periodical payment card, which positions the file by a key that is unknown
pPerPay->Browse (VARIANT_FALSE);
// Swap the key to 'PER_COD' (1), positioning by code
pPerPay->SwapKey (1);
// Navigate through the file using the key 'PER_COD'
while (pPerPay->GetDBStatus () == 0)
{
    // Process record data
    
    pPerPay->GetNext ();
}

C#
 
// Browse for a periodical payment card, which positions the file by a key that is unknown
oPerPay.Browse (false);
// Swap the key to 'PER_COD' (1), positioning by code
oPerPay.SwapKey (1);
// Navigate through the file using the key 'PER_COD'
while (oPerPay.GetDBStatus () == 0)
{
    // Process record data
    
    oPerPay.GetNext ();
}

VBS
 
' Browse for a periodical payment card, which positions the file by a key that is unknown
Call oPerPay.Browse(False)
' Swap the key to 'PER_COD' (1), positioning by code
Call oPerPay.SwapKey(1)
' Navigate through the file using the key 'PER_COD'
While oPerPay.GetDBStatus() = 0
    ' Process record data
    
    Call oPerPay.GetNext()
Wend

VB.NET
 
' Browse for a periodical payment card, which positions the file by a key that is unknown
oPerPay.Browse(False)
' Swap the key to 'PER_COD' (1), positioning by code
oPerPay.SwapKey(1)
' Navigate through the file using the key 'PER_COD'
While oPerPay.GetDBStatus() = 0
    ' Process record data
    
    oPerPay.GetNext()
End While