Bookshelf Home | Contents | Index | PDF | ![]() ![]() |
Siebel VB Language Reference > VB Language Reference > Open StatementThis standard VB statement opens a file for input or output. SyntaxOpen filename [For mode] [Access access] [lock] As [#]filenumber [Len = reclen] ReturnsA file opened in the specified manner. NOTE: The file opens in the default code page of the local operating system. File I/O does not support Unicode. UsageThe following keywords are used for mode, access, and lock: A file must be opened before any input/output operation can be performed on it. If filename does not exist, it is created when opened in append, binary, output, or random modes. If mode is not specified, it defaults to random. If access is not specified for random or binary modes, access is attempted in the following order: Read Write, Write, Read. If lock is not specified, filename can be opened by other processes that do not specify a lock, although that process cannot perform any file operations on the file while the original process still has the file open. Use the FreeFile function to find the next available value for filenumber. The reclen argument is ignored for Input, Output, and Append modes. ExampleThis example opens a file for random access, gets the contents of the file, and closes the file again. The second subprogram, (general) (declarations) Sub CreateFile Sub Button_Click See Also |
![]() |
![]() ![]() |
Siebel VB Language Reference |