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

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

VBS
 
' Browse for an analytical account, which positions the file by a key that is unknown
Call oAnAcc.Browse(False)
' Swap the key to 'AAC_COD' (2), positioning by the account number
Call oAnAcc.SwapKey(2)
' Show the selected account (you can then navigate through the file using the key 'AAC_COD')
Call oAnAcc.View()

VB.NET
 
' Browse for an analytical account, which positions the file by a key that is unknown
oAnAcc.Browse(False)
' Swap the key to 'AAC_COD' (2), positioning by the account number
oAnAcc.SwapKey(2)
' Show the selected account (you can then navigate through the file using the key 'AAC_COD')
oAnAcc.View()