## CHAPTER 12 

## Textfile Input and Output 

Communication between people and computer systems was already mentioned in Chapter 9, File Types. Both learn to understand through what is termed pattern recognition. Unfortunately, the patterns recognized most easily by people (mainly those of picture and sound) are very different from those acceptable to computer systems (electrical impulses). In fact, the expense of physically transmitting data - implying a translation of patterns legible to people into those legible to computer systems and vice versa - can be as costly as the processing of the data itself. (Consequently, much research is devoted to minimizing the cost by "automating" more of the translation process.) This task of communication is called input and output handling (I/O). 

People can transmit information to computer systems via input devices and media (e.g., keyboards, diskettes, pointing devices, tape cartridges, optical discs, magnetic tapes, terminals) and receive results via output devices and media (e.g., printers, magnetic tapes, diskettes, tape cartridges, optical discs, plotters, speakers, and video displays). What is common to most of these - and defined by each individual computer installation - is a set of legible characters (Chapter 2). It is over this character set that Pascal defines the standard type Text (see Chapter 9). 

It is important to remember that each such input-output device enforces certain conventions as to the meaning of specific characters and patterns (strings) of characters. For example, most printers enforce some maximum line length. Also, many older line printers interpret the 

