Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - rlock() lock current record in current database http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 rlock()             Lock current record in current database
------------------------------------------------------------------------------
 Declaration
   database.hdr

 Syntax
   func logical rlock extern

 Arguments
   None.

 Return
   A logical indicating the success of operation.

 Description
   The rlock() function attempts to lock the current record in the current
   database. If the lock is successful, rlock() returns .t. Any record or
   file lock assigned to the current alias is released, and if rlock()
   is unsuccessful, the locks are not restored.

   Once an rlock() is applied to a process, no other process can write to
   the record or lock the record. However, rlock() does not prevent another
   process from reading the locked record.

   The use of rlock() or arlock() is recommended when updating a record
   with the get/read, delete, recall, or replace (:=) commands.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   proc Test_rlock
   open sTest
   if .not. rlock()
      ? "Unable to access record..."
   endif
   unlock
   goto 1
   rlock()              // locks record 1
   goto 2
   rlock()              // releases lock on record 1 and locks record 2
   endproc

   proc main
   Test_rlock()
   endproc

See Also: arlock() unlock

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