Computer Science, asked by tr011217271, 2 months ago

write syntax to open a file as a sequential files

Answers

Answered by karthikeyajay88
1

Answer:

Opening sequential files

A sequential file can be opened in one of three modes: input, output, or append. After opening a file, you must close it before opening it in another mode.

The syntax is:

Open fileName [For {Input | Output | Append} ] As fileNumber [Len = bufferSize] [Charset = MIMECharsetName]

Where Input means read-only access to the file, Output means write-only access, and Append means write-only access starting at the end of the file. Access in all three sequential modes is one line at a time. To get an unused fileNumber, use the FreeFile function.

bufferSize is the number of characters loaded into the internal buffer before being flushed to disk. This is a performance-enhancing feature: the larger the buffer, the faster the I/O. However, larger buffer sizes require more memory. The default buffer size for sequential files is 512 bytes.

MIMECharsetName designates the character set. The default is the platform-native character set, except that if a UTF-16 or UTF-8 byte order mark (BOM) is present, the BOM character set is used, and on OS/400® the CCSID is used if a BOM is not present. See MIME charset names for a list of valid MIME charset values.

When you try to open a file for sequential input, the file must already exist. If it doesn't, you get an error. When you try to open a nonexistent file in output or append mode, the file is created automatically.

Explanation:

This may help u plzz follow and mark as brainlist

Similar questions