StockDocDet::SwapKey (Interface: StockDocDet)
 
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
CreateStockDocDet
Browse
GetDBStatus
GetNext
The possible keys (and their numerical value) can be found in the SeekBy-methods of this interface.
 
Samples
 
C++
 
// Browse for a stock document detail line, which positions the file by a key that is unknown
pStockDocDet->Browse (VARIANT_FALSE);
// Swap the key to 'STC_LNE' (1), positioning by document
pStockDocDet->SwapKey (1);
// Navigate through the file using the key 'STC_LNE'
while (pStockDocDet->GetDBStatus () == 0)
{
    // Process record data
    
    pStockDocDet->GetNext ();
}

C#
 
// Browse for a stock document detail line, which positions the file by a key that is unknown
oStockDocDet.Browse (false);
// Swap the key to 'STC_LNE' (1), positioning by document
oStockDocDet.SwapKey (1);
// Navigate through the file using the key 'STC_LNE'
while (oStockDocDet.GetDBStatus () == 0)
{
    // Process record data
    
    oStockDocDet.GetNext ();
}

VBS
 
' Browse for a stock document detail line, which positions the file by a key that is unknown
Call oStockDocDet.Browse(False)
' Swap the key to 'STC_LNE' (1), positioning by document
Call oStockDocDet.SwapKey(1)
' Navigate through the file using the key 'STC_LNE'
While oStockDocDet.GetDBStatus() = 0
    ' Process record data
    
    Call oStockDocDet.GetNext()
Wend

VB.NET
 
' Browse for a stock document detail line, which positions the file by a key that is unknown
oStockDocDet.Browse(False)
' Swap the key to 'STC_LNE' (1), positioning by document
oStockDocDet.SwapKey(1)
' Navigate through the file using the key 'STC_LNE'
While oStockDocDet.GetDBStatus() = 0
    ' Process record data
    
    oStockDocDet.GetNext()
End While