The Lock and Unlock functions are used in environments where several processes might need access to the same file.
Lock and Unlock functions are always used in pairs. The arguments to Lock and Unlock must match exactly.
If Record, or FromRecord and ToRecord are not supplied, the lock will be for the entire file. If Record alone is specified 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 FromRecord andToRecord.