ProvideX V8.20 > Language Reference > 2. Directives
199
LOCK Directive
             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 label to transfer control to.
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.
See Also
UNLOCK Remove Exclusive Use from File, p.347
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