Free course vb : Data Files

Free course vb : Data Files







Free course vb : Data Files














What occurs when open statement is executed ?

We can use open statement for both i.e. sequential and random access files. Open statement reserves file handle, also called a channel for reading from and writing to a file. The open statement associates number to the handle. A file handle is a unique path to file associated with a number from the open statement. Open statement associates a number to the handle after that we can use the file number to access the file. Similarly, we have to specify the mode in which we want to open the file. These mode can be read , write or both.

3. List and explain the file modes for data files.

File modes for data files are as follows:

i) Append:
Opens a file for sequential output starting at the end of file.

ii) Input:
Opens a file for sequential input, we can read from the file.

iii) Output:
Opens a file for sequential output, starting from beginning of file.

iv) Random:
Open a file for random read and write access. This mode allows to read and write to a file at any specified record boundaries.


4. What is the significance of file number?

A file number is used to maintain the files. In the project suppose we have large number of files , so instead of using the various file names we refer to the file numbers.
Syntax is as follows:

Open “filename” # 1
For ex.

Open “Abc.txt” # 1

Above statement opens the file Abc.txt. It associates a file number one to abc.txt To refer to this file we can use this file number.


6. What is the format for the statements to read and write sequential files?

Sequential file contains data elements that are stored one after another in sequence. When we read the data from the disk, it must be read in the same sequence in which it was written. To read any particular element of data, all proceeding must first be read.

As data elements are written on disk, string fields are enclosed in quotation marks and fields and separated by, records are generally terminated a carriage written character......






Download Free course vb : Data Files









Free course vb : Data Files



0 commentaires: