File Not Found in Delphi (FMX)

  

I am trying to load a bunch of lines from a text file located in same directory as the .dproj and Delphi can’t find the file I’m trying to read from.
the code is as follows:
procedure TFoPrincipale.Button2Click(Sender: TObject);
var monFich : TextFile;
Sligne : string;
begin
try
AssignFile(monFich, ‘docText.txt’);
Reset(monFich);
except
showmessage(‘Le fichier est introuvable’);
exit;
end;

while not Eof (monFich) do
begin
Readln(monFich, Sligne);
Memo1.Lines.Add(Sligne);
end;

CloseFile(monFich);

end;

Comments are closed.