procedure SavetoFile(str:string);stdcall;
var
f:textfile;
begin
assignfile(f,'c:/abc.txt');
if fileexists('c:/abc.txt')=false then rewrite(f)
else append(f);
if strcomp(pchar(str),pchar('#13#10'))=0 then writeln(f,'')
else write(f,str);
closefile(f);
end;