Handling files in Delphi is not so different from handling files in any other high level programming language. In this article we will examine how to read and write to text files and binary files and we will also explore various methods of accessing files.
There are two types of read procedures, readln and read. The difference is that Readln moves to the pointer to the next line after reading and Read does not. Here's how you would read from a file using Read procedure:
var Afile : TextFile; buffer : string begin AssignFile(Afile, 'notes.txt') ;