menu prev next

FILE HANDLING
So far, data has been inputted from the keyboard, and outputted to the console screen.

The keyboard is known as the standard input device, and the console screen is the standard output device. Pascal names these as INPUT and OUTPUT respectively.

Occasions arise where data must be derived from another source other than the keyboard. This data will exist external to the program, either stored on diskette, or derived from some hardware device.

In a lot of cases, hardcopy (a printout) of program results is needed, thus the program will send the output to either the printer or the disk instead of the screen.

A program which either reads information from, or writes information to, a place on a disk, is performing FILE Input/Output (I/O).

A File is a collection of information. In Pascal, this information may be arranged as text (ie a sequence of characters), as numbers (a sequence of integers or reals), or as records. The information is collectively known by a sequence of characters, called a FILENAME.

You have already used filenames to identify the source programs written and used in this tutorial.


Copyright B Brown/P Henry/CIT, 1988-1997. All rights reserved.
menu prev next

1