P
purple
Misafir
bir butonclick altında sistem tarihini bir txt dosyasına yazdırmak istiyorum.aynı butonclick altında başka bir veriyi başka bir txt dosyasına yazdırabilirken,tarihi bir türlü yazdıramadım,nerde hata yapıyorum?kod şu:
var
F: TextFile;
P: TextFile;
zaman:string;
begin
if edit1.text<>veri then
begin
Showmessage(' Yanlış veri');
end
else if edit1.text=veri then
begin
zaman:=datetostr(date);
AssignFile(F, 'C:\A1.txt');
{$i-} Reset(F); {$i+}
if IOResult = 0 then
begin
CloseFile(F);
Rewrite(F);
Writeln(F, veri);
end
else
begin
ShowMessage('Doğru veri daha önce girilmiş.');
CloseFile(F);
end;
AssignFile(P, 'C:\BB.txt');
{$i-} Reset(P); {$i+}
if IOResult = 0 then
begin
CloseFile(P);
Rewrite(P);
Writeln(P,zaman);
end;
end;
end;

var
F: TextFile;
P: TextFile;
zaman:string;
begin
if edit1.text<>veri then
begin
Showmessage(' Yanlış veri');
end
else if edit1.text=veri then
begin
zaman:=datetostr(date);
AssignFile(F, 'C:\A1.txt');
{$i-} Reset(F); {$i+}
if IOResult = 0 then
begin
CloseFile(F);
Rewrite(F);
Writeln(F, veri);
end
else
begin
ShowMessage('Doğru veri daha önce girilmiş.');
CloseFile(F);
end;
AssignFile(P, 'C:\BB.txt');
{$i-} Reset(P); {$i+}
if IOResult = 0 then
begin
CloseFile(P);
Rewrite(P);
Writeln(P,zaman);
end;
end;
end;