Bookshelf Home | Contents | Index | PDF |
Siebel VB Language Reference > VB Language Reference > Lock StatementThis standard VB statement controls access to an open file. SyntaxLock [#]filenumber[, [start] [To end]] ReturnsUsageFor 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 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. ExampleThis example locks a file that is shared by others on a network, if the file is already in use. The second subprogram, (general) (declarations) Sub CreateFile Sub Button_Click See Also |
Siebel VB Language Reference |