Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_tstatus( [ <ntid> ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_TSTATUS( [ <nTID> ] )


Parameters

<nTID>
Transaction ID number obtained as a return value from N_TCOMMIT() or 
N_TROLLBACK().


Returns

N_TSTATUS() with no parameters returns 'A' if TTS is active and 
available.

N_TSTATUS( <nTID> ) returns 'A' if the file server is still processing 
a transaction (flushing cache buffers, rolling back, and so on).


Description Reports if TTS is active or, when a transaction ID 
number is passed, whether the transaction is complete.

It is not necessary to wait for the completion of a transaction before 
beginning another, nor is it necessary to monitor a transaction's 
progress.

Issue N_TSTATUS() at least one time at the start of the application 
(after the first N_READY(), and before any transactional files are 
opened). This has the dual effect of informing your program if TTS is 
active, as well as enabling explicit TTS transactions, which Clipper 
requires.


Example

// Mark as a non-transaction file before packing
DO WHILE !N_FATTRSET('CUSTFILE.DBF', 'TRANSACTION', .F.)
ENDDO
USE Custfile EXCLUSIVE
PACK
USE  // file cannot be in use
// Check to see if TTS is active before
// setting transactional attribute on
IF 'A' $ N_TSTATUS()
   N_FATTRSET('CUSTFILE.DBF', 'TRANSACTION', .T.)
ENDIF



See Also: N_TCOMMIT() N_TROLLBACK()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson