Syntax |
Unlock [#] filenumber [,{record | [start] To end}] |
||
Description |
Unlocks a section of the specified file, allowing other processes access to that section of the file. |
||
Comments |
The Unlock statement requires the following parameters: |
||
|
Parameter |
Description |
|
|
filenumber |
Integer used by the Basic Control Script to refer to the open fileāthe number passed to the Open statement. |
|
|
record |
Long specifying which record to unlock. |
|
|
start |
Long specifying the first record within a range to be unlocked. |
|
|
end |
Long specifying the last record within a range to be unlocked. |
|
|
For sequential files, the record, start, and end parameters are ignored: the entire file is unlocked. The section of the file is specified using one of the following: |
||
|
Syntax |
Description |
|
|
No record specification |
Unlock the entire file. |
|
|
record |
Unlock the specified record number (for Random files) or byte (for Binary files). |
|
|
to end |
Unlock from the beginning of the file to the specified record (for Random files) or byte (for Binary files). |
|
|
start to end |
Unlock the specified range of records (for Random files) or bytes (for Binary files). |
|
|
The unlock range must be the same as that used by the Lock statement. |
||
Example |
This example creates a file named test.dat and fills it with ten string variable records. These are displayed in a dialog box. The file is then reopened for read/write, and each record is locked, modified, rewritten, and unlocked. The new records are then displayed in a dialog box. Const crlf = Chr$(13) + Chr$(10) Sub Main() msg1 = "" msg1 = "" Kill "test.dat" |
||
See Also |
|||
|
|
|
|
U |