Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RaSQL/B 6.1a for Clipper - <b>n_xrlock()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_XRLOCK()
Lock current record

Syntax
N_XRLOCK()

RDD
Use RLOCK()

Returns
True if successful.

Remarks
Works similarly to the Clipper RLOCK command, in that RaSQL/B will attempt 
to lock the current record and return .T. if successful, or .F. otherwise. 
Unlike the Clipper RLOCK command N_XRLOCK() does not unlock the previously 
locked record. Thus N_XRLOCK() permits the program to lock multiple records 
in the same table, as in the example below.

N_XUNLOCK() releases all locked records in the current file.  You cannot 
unlock selected records.

It is not possible to lock a file in Btrieve. Thus, there is no N_XFLOCK() 
function.

Always returns True if the file has been opened in exclusive mode, or if no 
file is open in the current area.

Example
* Lock all records where state = 'NY'
all_locked = .T.
N_XSEEK('NY')

DO WHILE N_XFETCH('state') = 'NY' .AND.;
  all_locked
  IF !N_XRLOCK()
    all_locked = .F.
  ENDIF
  N_XSKIP()
ENDDO

IF !all_locked
  N_XUNLOCK() && Release records that 
                && might already be locked!
ENDIF


See Also: N_XUNLOCK()

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