Files


There are many approaches to handle files in Object Pascal. The most important three
file types are:

1. Text files
2. Typed files
3. Untyped files

All files in Object Pascal and most other programming languages always passes through
these four steps:

1. Assigning file name to a file variable or a handle.
2. Opening file for reading, writing, or reading/writing.
3. Reading file data or writing data to file.
4. Closing file.

Example:

1. AssignFile(F, 'c:\autoexec.bat');
2.
Reset(F);
3.
Readln(F, FirsLine);
4.
CloseFile(F);

See also:

Text files
Typed files
Untyped files