TxnLevel Function | |
-- todo --
Returns a numeric value indicating the current transaction level.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax FUNCTION TxnLevel() AS LONG
public static int TxnLevel()
Request Example
View SourceReturn Value
Type:
Long
TXNLEVEL( )Return Value
Numeric
Remarks
Use BEGIN TRANSACTION to create a transaction. Transactions are nested by issuing BEGIN TRANSACTION when another transaction is in progress.
Transactions can be nested in this manner to five levels. Use TXNLEVEL( ) to determine the current transaction level.
TXNLEVEL( ) returns a value from 0 to 5. TXNLEVEL( ) returns 0 if a transaction is not in progress.
Examples 1Close Databases
2Open Database (HOME(2) + 'Data\testdata')
3Use Customer
4Clear
5BEGIN TRANSACTION
6tLevel = ALLTRIM(STR(TXNLEVEL()))
7=MessageBox("Current Transaction: " + tLevel, 0, "Transaction Level")
8BEGIN TRANSACTION
9tLevel = ALLTRIM(STR(TXNLEVEL()))
10=MessageBox("Current Transaction: " + tLevel, 0, ;
11"Transaction Level")
12END TRANSACTION
13END TRANSACTION
See Also