I'm having a problem where when passing through the function write
it ends up locking inside the function, and does not return anything, having to close the application and open again, below the code for test, just create a project and paste the code in FormCreate:
procedure TForm1.FormCreate(Sender: TObject);
var
F : TextFile;
mArquivo,s : String;
i: integer;
begin
{$i+}
mArquivo := 'C:\Users\Rodrigo\Desktop\teste.txt';
AssignFile(F,mArquivo);
if FileExists(mArquivo) then
DeleteFile(mArquivo);
Rewrite(F,mArquivo);
Append(F);
for i := 0 to 10 do
begin
S := 'Text'+ IntToStr(i);
Write(F,S);
end;
CloseFile(F);
end;