An alternative to using a memo is to use a TextFile variable. The following function accepts the file name as a parameter and returns the first line of the file as a string:
function ReadFirstLine(FileName: TFileName): String;
var
F: TextFile;
begin
AssignFile(F, FileName);
Reset(F);
Readln(F, Result);
CloseFile(F);
end;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.