There is a basic explanation about how to handle files in the wiki's Pascal Introduction, in the page:
Files.
Basically what you do is:
procedure TForm1.FileCheck;
var
MyFile: Text; { or TextFile }
ALine: String;
begin
AssignFile(MyFile, 'MyFileName.ext');
Reset(MyFile);
ReadLn(MyFile, ALine);
CloseFile(MyFile);
if MyLine = '<text1>helloworld</text1>' then
Speedbutton1.Caption := 'Yes'
else
Speedbutton1.Caption := 'No';
end;
You should, of course, add the habitual error checking, etc. to make it robust; that's just an example!
Note also that, unlike in the page cited above, this code uses
AssignFile and
CloseFile; those are convenience aliases to
System.Assign and
System.Close declared in the LCL because those two words are used there as methods of most objects and would clash otherwise.