Site hosted by Angelfire.com: Build your free website today!
NAME
  LOCK, UNLOCK Statements

SYNOPSIS
  LOCK [#]filenumber% [,{record& | [start&] TO end&}]
  UNLOCK [#]filenumber% [,{record& | [start&] TO end&}]
      o filenumber%        The number of an open file.
      o record&            For random-access files, the number of a record to
                           lock, relative to the first record in the file.
                           For binary files, the number of a byte to lock,
                           relative to the first byte in the file.
      o start& and end&    The numbers of the first and last records or bytes
                           in a range of records or bytes to lock or unlock.
      o For sequential files, LOCK and UNLOCK affect the entire file.

DESCRIPTION
  LOCK limits or prevents access to a file by a network process.
  UNLOCK releases the locks imposed by the last LOCK statement.

  Example:
      'This example runs only in a network environment.
      OPEN "TEST.DAT" FOR RANDOM AS #1
      FOR i% = 1 TO 10
          PUT #1, , i%
      NEXT i%
      LOCK #1, 2         'Lock record 2.
      GET #1, 2, i%
      UNLOCK #1, 2       'Unlock record 2.

SEE ALSO
  none