Download CIMPLICITY BCE Language Reference Manual

Transcript
Random
Same as Binary files
The lock parameter determines what access rights are granted to other processes that attempt to
open the same file. The following table describes the values for lock:
lock Value
Description
Shared
Another process can both read this file and write to it. (Deny none.)
Lock Read
Another process can write to this file but not read it. (Deny read.)
Lock Write
Lock Read
Write
Another process can read this file but not write to it. (Deny write.)
Another process is prevented both from reading this file and from writing
to it. (Exclusive.)
If lock is not specified, then the file is opened in Shared mode.
If the file does not exist and the lock parameter is specified, the file is opened twiceonce to create
the file and again to establish the correct sharing mode.
Files opened in Random mode are divided up into a sequence of records, each of the length
specified by the reclen parameter. If this parameter is missing, then 128 is used. For files opened
for sequential I/O, the reclen parameter specifies the size of the internal buffer used by the Basic
Control Engine when performing I/O. Larger buffers mean faster file access. For Binary files, the
reclen parameter is ignored.
Example
This example opens several files in various configurations.
Sub Main()
Open "test.dat"
Close
Open "test.dat"
Close
Open "test.dat"
Close
Open "test.dat"
Close
Open "test.dat"
Close
Open "test.dat"
Close
Kill "test.dat"
End Sub
See Also
16-10
For Output Access Write Lock Write As #2
For Input Access Read Shared As #1
For Append Access Write Lock Read Write As #3
For Binary Access Read Write Shared As #4
For Random Access Read Write Lock Read As #5
For Input Access Read Shared As #6
Close (statement); Reset (statement); FreeFile (function).
CIMPLICITY HMI Basic Control Engine Language Reference Manual–July 2001
GFK-1283G