Greetings,I was handling my Computer Science project and this problem had me stopped for like half an hour,I wanted to create a text file for each time I click the button, however using assign() function didn't seem to work,here's the code.
procedure TForm1.Button1Click(Sender: TObject);
var f : text;
fn : string;
begin
memo1.Clear;
fn := 'C:\SBA(ICT) 7_2\Fault Reports\Pending\' + datetimetostr(now) + '.txt';
if Rm <> ''
then if Eq <> ''
then if Er <> ''
then begin
Assignfile(f,fn);
rewrite(f);
showmessage('Creation successful');
writeln(f,Rm);
writeln(f,Eq);
end
else showmessage('You have not select the fault yet!')
else showmessage('You have not select the equipment yet!')
else showmessage('You have not select the room yet!')
end;
P.S. I'm new to this forum,so if I violated some rules,be sure to let me know and it won't happen next time.