Siebel VB Language Reference > VB Language Reference >

Unlock Statement


This standard VB statement controls access to an open file.

Syntax

Unlock [#]filenumber[, {record | [start] To end} ]

Argument
Description

filenumber

The file number used in the Open statement to open the file

record

An integer indicating the first record to unlock

start

A long integer indicating the first record or byte offset to unlock

end

A long integer indicating the last record or byte offset to unlock

Returns

Not applicable

Usage

For Binary mode, start and end are byte offsets. For random mode, start and end are record numbers. If start is specified without end, then only the record or byte at start is locked. If end is specified without start, then the records or bytes from record number or offset 1 to end are locked.

For input, output, and append modes, start and end are ignored and the whole file is locked.

Lock and Unlock always occur in pairs with identical arguments. Locks on open files must be removed before closing the file, or unpredictable results may occur.

Example

For an example of the Unlock statement, read Lock Statement.

See Also

Lock Statement
Open Statement

Siebel VB Language Reference