NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Lock, Unlock Statements

Controls access by other processes to all or part of a file opened using the Open statement.

Lock (channel, start, finish) 
. . .
Unlock (channel, start, finish) 

Arguments

channel
Required. Any valid file number.
start
Optional. Number of the first record or byte to lock or unlock.
finish
Optional. Number of the last record or byte to lock or unlock.

Remarks

The Lock and Unlock statements are used in environments where several processes might need access to the same file.

Lock and Unlock statements are always used in pairs. The arguments to Lock and Unlock must match exactly.

If the start and finish are not supplied, the lock will be for the entire file. If the start is specified but not the finish, the single record will be locked/unlocked.

If the file has been opened for sequential input or output, Lock and Unlock affect the entire file, regardless of the range specified by start and end.See Also

Example

Open Statement