It depends of what type of file you want to read.
TealWren has the ultimate way to read raw text files, but if you want to read standard ini-files you should use TIniFile.
Example Code (You must implement IniFiles in the Uses clause:
function ReadIniFile(FileName: String; Section, Prop, Value, Default: String): String;
begin
with TIniFile.Create(Filename) do
try
Result := ReadString(Section, Prop, Default);
finally
Free;
end;
end;
Example of ini-file
[Section]
Property=Value
If you want to retrieve the value above, just call my function like this:
s := ReadIniFile('Section','Property','Default when not found');