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_mlock( <crecordlist> ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_MLOCK( <cRecordList> )


Parameters

<cRecordList>
List of record numbers to lock, passed as a comma-delimited string. For 
example, 

N_MLOCK('1, 4, 12, 25')

will lock record numbers 1, 4, 12, and 25. NetLib will ignore trailing 
commas as well as leading and trailing spaces between numbers in the 
list.


Returns

Logical true if all records in the list have been locked. Logical false 
if the records were not locked. Common reasons for failure are that one 
of the records in the list is already locked or another user has the 
file opened in exclusive mode.


Description

Enables you to apply locks to a list of records in a file. The function 
applies the locks just as if you had called RLOCK() for each record in 
the list. The only difference is that if one of the records cannot be 
locked, none of the locks are applied. N_MLOCK() releases any previous 
FLOCK() or RLOCK() in the same work area. Records locked by N_MLOCK() 
will be released by a subsequent FLOCK() or RLOCK() in the same work 
area as well as by an explicit UNLOCK.


Example

// Lock records where State = 'WA'.
// (Assume the index is by state.)
SEEK 'WA'
DO WHILE State == 'WA'
   cLockList = cLockList + LTRIM(STR(RECNO())) + ','
   SKIP
ENDDO

N_TIMEOUT(10) // Retry locks up to ten times

IF N_MLOCK(cLockList)
   // Records locked.

ELSE
   // Records not locked.
   ? 'Could not lock record number ', N_BADLOCK()
ENDIF



See Also: N_BADLOCK() N_CHECKR() N_SETMULTI() N_TIMEOUT()

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