xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

NetLock()

Applies locks to a database file or record with timeout.

Syntax

NetLock( <nType>         , ;
        [<lReleaseLocks>], ;
        [<nSeconds>]       ) --> lSuccess

Arguments

<nType>
The following #define constants must be used for <nType> to specify the requested locking type. They are listet in the TTable.ch file:

Types for locks in a network
ConstantValueDescription
NET_RECLOCK1Obtains a record lock.
NET_FILELOCK2Obtains a file lock.
NET_APPEND3Adds a new record.

<lReleaseLocks>
This parameter defaults to .F. (false) which leaves all current locks intact. Passing .T. (true) causes all pending record locks be released before the requested operation is performed.
<nSeconds>
Optionally, a numeric value can be passed specifying the amount of seconds to retry the operation before the function returns without success. It defaults to the return value of SetNetDelay().

Return

The function returns .T. (true) when the requested operation is successfully executed, otherwise .F. (false) is returned.

Description

NetLock() is a utility function used by NetAppend(), NetFileLock() and NetRecLock() to obtain different locks for a database open in shared mode.

Info

See also:NetAppend(), NetFileLock(), NetRecLock()
Category: Database functions , Network functions , xHarbour extensions
Header:TTable.ch
Source:rtl\ttable.prg
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe