NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

HxLink DID NOT INITIALIZE

Open Statement

Question: If Close is now a Function, is Open still a Statement?

Enables input/output (I/O) to a file.

Open (channel, filename, mode, access, share, recordlength)

Arguments

channel
Required. Any valid file number Use the FreeFile function to obtain the next available file number.
filename
Required. String expression that specifies a file name — may include directory or folder, and drive.
mode
Optional Enum specifying the file mode: Append, Binary, Input, Output, or Random. If unspecified, the file is opened for Random access.
access
Optional. Keyword specifying the operations permitted on the open file: Read, Write, or ReadWrite. Defaults to ReadWrite.
share
Optional. Enum specifying the operations restricted on the open file by other processes: Shared, Lock Read, Lock Write, and Lock Read Write. Defaults to Shared.
recordlength
Optional. Number less than or equal to 32,767 (bytes). For files opened for random access, this value is the record length. For sequential files, this value is the number of characters buffered.

Remarks

You must open a file before any I/O operation can be performed on it. Open allocates a buffer for I/O to the file and determines the mode of access to use with the buffer.

If the file specified by pathname doesn't exist, it is created when a file is opened for Append, Binary, Output, or Random modes.

The channel to open can be found using the Freefile() function.

See Also

Example

Close Function | FreeFile Function | Writing Data to Files