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

C#
 
// Browse for a sales invoice, which positions the file by a key that is unknown
oSInvce.Browse (false);
// Swap the key to 'SIH_NUM' (1), positioning by book and document number
oSInvce.SwapKey (1);
// Show the selected sales invoice (you can then navigate through the file using the key 'SIH_NUM')
oSInvce.View ();

VBS
 
' Browse for a sales invoice, which positions the file by a key that is unknown
Call oSInvce.Browse(False)
' Swap the key to 'SIH_NUM' (1), positioning by book and document number
Call oSInvce.SwapKey(1)
' Show the selected sales invoice (you can then navigate through the file using the key 'SIH_NUM')
Call oSInvce.View()

VB.NET
 
' Browse for a sales invoice, which positions the file by a key that is unknown
oSInvce.Browse(False)
' Swap the key to 'SIH_NUM' (1), positioning by book and document number
oSInvce.SwapKey(1)
' Show the selected sales invoice (you can then navigate through the file using the key 'SIH_NUM')
oSInvce.View()