You are on page 1of 3

File Handling & Sub-Programming

Chapter 13

What are files? How files are handled in computer?


A computer can process large amounts of data. It is always useful to store input and output it a data file. A file consists of record stored on a secondary storage device such as disk. These records can be organized in different ways. Using file-handling techniques the same 'data can be .used over and over again or modified. BASIC supports two different techniques to organize files
Sequential files Random access files

The open and close statements


Before a file can be read or written, it must first be activate or accessed with the use of an OPEN statement. The OPEN and CLOSE statements are used to open file for processing and to close it if necessary processing. To be used for input, a file must already exist. Once a file has been opened for output, we can write information on it using the WRITE statement, which is like the PRINT statement except that is places a comma after each item of the output

You might also like