[prev] [prev-tail] [tail] [up]

#### File types

File types are types that store a sequence of some base type, which can be any type except another file type. It can contain (in principle) an infinite number of elements. File types are used commonly to store data on disk. Nothing prevents the programmer, however, from writing a file driver that stores it’s data in memory. Here is the type declaration for a file type:

_________________________________________________________________________________________________________ File types
___________________________________________________________________

If no type identifier is given, then the file is an untyped file; it can be considered as equivalent to a file of bytes. Untyped files require special commands to act on them (see Blockread (458), Blockwrite (460)). The following declaration declares a file of records:

     Type
        Point = Record
          X,Y,Z : real;
          end;
        PointFile = File of Point;

Internally, files are represented by the FileRec record, which is declared in the DOS unit.

A special file type is the Text file type, represented by the TextRec record. A file of type Text uses special input-output routines.

[prev] [prev-tail] [front] [up]