Difference between revisions of "DBF LOCKR()"
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) m (Text replace - "lianjaapi.h" to "lianja_api.h") |
||
Line 7: | Line 7: | ||
==SYNOPSIS== | ==SYNOPSIS== | ||
<code lang="c"> | <code lang="c"> | ||
− | #include " | + | #include "lianja_api.h" |
int DBF_LOCKR(recnum) | int DBF_LOCKR(recnum) | ||
Line 29: | Line 29: | ||
<code lang="c"> | <code lang="c"> | ||
− | #include " | + | #include "lianja_api.h" |
lianjaapi_dbf_lockr() | lianjaapi_dbf_lockr() |
Latest revision as of 06:56, 11 April 2013
PURPOSE
Lock a record
SYNONYM
api_dbf_lockr()
SYNOPSIS
#include "lianja_api.h" int DBF_LOCKR(recnum) <input parameters> long recnum; /* Record number */ <output parameters> none
DESCRIPTION
The DBF_LOCKR() function will lock the specified record. A value of -1 will be returned if there is no table open in the current cursor or the specified record number to lock is out of range.
The record lock will be issued when no other user has a file lock or the specified record locked.
The table will still be opened for shared read/write access for other users however they will not be able to update the record you have locked until you release the record lock.
EXAMPLE
The following example locks the current record.
#include "lianja_api.h" lianjaapi_dbf_lockr() { int locked; if (DBF_ISEXCLUSIVE() == 0 ) { locked = DBF_LOCKR(DBF_RECNO()); } else { locked = -1; } _retl( (locked) ? 1 : 0 ); }
SEE ALSO
BLOB_UPDATE(), BLOB_WRITE(), DBF_APPEND(), DBF_DELETE(), DBF_ISEXCLUSIVE(), DBF_ISREADONLY(), DBF_LOCKF(), DBF_RECALL(), DBF_RECNO(), DBF_UNLOCKF(), DBF_UNLOCKR(), DBF_UPDATE(), FIELD_UPDATE(), MEMO_UPDATE(), MEMO_WRITE()