Accnt::SwapKey (Interface: Accnt)
 
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
CreateAccnt
Browse
View
The possible keys (and their numerical value) can be found in the SeekBy-methods of this interface.
 
Samples
 
C++
 
// Browse for a general account, which positions the file by a key that is unknown
pAccnt->Browse (VARIANT_FALSE);
// Swap the key to 'ACC_NUM' (1), positioning by the account number
pAccnt->SwapKey (1);
// Show the selected account (you can then navigate through the file using the key 'ACC_NUM')
pAccnt->View ();

C#
 
// Browse for a general account, which positions the file by a key that is unknown
oAccnt.Browse (false);
// Swap the key to 'ACC_NUM' (1), positioning by the account number
oAccnt.SwapKey (1);
// Show the selected account (you can then navigate through the file using the key 'ACC_NUM')
oAccnt.View ();

VBS
 
' Browse for a general account, which positions the file by a key that is unknown
Call oAccnt.Browse(False)
' Swap the key to 'ACC_NUM' (1), positioning by the account number
Call oAccnt.SwapKey(1)
' Show the selected account (you can then navigate through the file using the key ('ACC_NUM')
Call oAccnt.View()

VB.NET
 
' Browse for a general account, which positions the file by a key that is unknown
oAccnt.Browse(False)
' Swap the key to 'ACC_NUM' (1), positioning by the account number
oAccnt.SwapKey(1)
' Show the selected account (you can then navigate through the file using the key 'ACC_NUM')
oAccnt.View()