I'm running Windows 10, 64 bit, latest version 2.0.2 of Lazarus
I open a file, read it, write to new file, close it.
No errors.
No new file in the default directory, or anywhere else for that matter.
I'm missing something so basic, but can't see it.
procedure TForm1.Button1Click(Sender: TObject);
var InFile : TextFile;
OutFile : TextFile;
Lp1, Lp2 : Integer;
Str : String;
begin
AssignFile(InFile,'ResidentData.TXT');
ReSet(InFile);
AssignFile(OutFile,'NewDirectory.TXT');
ReWrite(OutFile);
{$I+}
if IOResult = 0 then Button1.Caption := 'Good';
ReadLn(InFile,Str);
WriteLn(OutFile,Str);
ReadLn(InFile,Str);
WriteLn(OutFile,Str);
for Lp1 := 1 to 207 do // 207 lines.
begin
ReadLn(InFile,Str);
WriteLn(OutFile,Str);
end; // lp1.
//Flush(OutFile);
CloseFile(OutFile);
end;