Introduction

Language Structure

IB Statements

File System

Comet 32 Runtime

Index

LOCK statement

Syntax: LOCK (lun) [,EXCP=statement-label | NOEXCP]
Discussion: The LOCK statement locks a logical unit number. It is a way to prevent a specified file from being opened by another user.

The lun parameter is a numeric or symbolic constant that is previously assigned to a file by an OPEN statement -- it represents the logical unit to be locked.

If th LOCK statement is attempted while another user has the particular file open, an exception 7 (FILE UNAVAILABLE -- LOCK/UNLOCK ERROR) will be encountered.

Example:
OPEN (1) "FILEB"
LOCK (1)
.
.
.
UNLOCK (1)
CLOSE (1)