procedure
write_outfile_new(l,alpha,fi_s,mashi:
integer
; t:
real
);
var
Xa,Yb,k:
integer
;
begin
AssignFile(outfile,
'outfile.txt'
);
Reset(outfile);
AssignFile(new_outfile,
'new_outfile.txt'
);
ReWrite(new_outfile);
while
not
Seekeof(outfile)
do
begin
read(outfile, Xa);
read(outfile, Yb);
if
sqrt(sqr(Xa-t*alpha*cos(fi_s*pi/
180
)*mash/mashi)+sqr(Yb-t*alpha*sin(fi_s*pi/
180
)*mash/mashi))<(l*mash/mashi)
then
begin
Append(new_outfile);
writeln
(new_outfile, Xa,
' '
,Yb);
end
end
;
CloseFile(new_outfile);
CloseFile(outfile);
sl1:= TStringList
.
Create;
sl2:= TStringList
.
Create;
Try
sl1
.
LoadFromFile(
'outfile.txt'
);
sl2
.
LoadFromFile(
'new_outfile.txt'
);
for
g := sl1
.
Count -
1
downto
0
do
if
sl2
.
IndexOf(sl1[g]) >=
0
Then
sl1
.
Delete(g);
sl1
.
SaveToFile(
'outfile.txt'
);
Finally
sl1
.
Free;
sl2
.
Free;
End
;
end
;