Open
This method opens a file in either the Input (1), Output (2), Random (4), Append (8), or Binary mode (32).
Syntax
file.Open pathname, mode, [access], [lock], [reclength]
Parameters
- file
- Reference to a File control.
- pathname
- String expression that specifies a file name.
- mode
- Specifies the file mode: Input (1), Output (2), Random (4) , Append (8), or Binary (32).
- access
- Operation permitted on the open file: Read, Write, or ReadWrite [Default]. (1, 2, 3)
- lock
- Operations permitted on the open file by other processes: Shared, LockRead, LockWrite [Default], and LockReadWrite. (1, 2, 3, 0)
- reclength
- Number, in bytes, that is less than 32,767. For files opened for random access, this value is the record length. For sequential files, this value is the number of characters buffered.
Return Value
None.
Remarks
The reclength parameter is ignored if the mode is Binary. When opening a file in Random mode, you must specifiy a record size of greater than zero or an error will occur.