Directives
LOCK Reserve File for Exclusive Use
   
Format LOCK (chan[,ERR=stmtref])

Where:

chan Channel or logical file number of the file to be locked.
stmtref Program line number or statement label to which to transfer control.
   
Description Use the LOCK directive to reserve a given file for exclusive processing by the user/program. Once a file is locked, no other user or program can gain access to it. However, if another user already has the given file open, the OPEN and LOCK directives fail and ProvideX returns Error #0: Record/file busy.


*Note* WindX supports the use of this directive for file opened using the [WDX] or [LCL] tag. Prior version 5 you will need to use an EXECUTE command to send the LOCK directive to the workstation. See [WDX] Direct Action to Client Machine.


See Also UNLOCK Remove Exclusive Use from File
   
Examples 0010 OPEN (30,ERR=0100)"GLFILE"
0020 LOCK (30,ERR=0120)
...
0100 PRINT "Cannot open GLFILE"
0110 STOP
0120 PRINT "GL still in use—try later"
0130 STOP