3
I’m having a problem where by going through the job 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 testing, just create a project and paste the code into 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;
Buddy, I don’t have the Seatle, and yes the XE 7, but what are the parameters requested by the function Rewrite()? Because trying to play your code, I just passed the variable F in function Rewrite and everything worked out correctly.
– Andrey
Now that you spoke, it worked even taking away the argument that was there, to tell the truth had not realized this field and it worked.
– William