O
optn3
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button14Click(Sender: TObject);
var
i,j,k,s,b1,b2:integer;
v:real;
st1,st2:string;
s1,s2,s3:TStringList;
begin
s1:=TStringList.Create;
s2:=TStringList.Create;
s3:=TStringList.Create;
s1.Text := memo8.Text;
s2.Text := memo12.Text;
for i := 0 to s2.Count -1 do
begin
b1:=0;
b2:=0;
s:=0;
st1:= ansimidstr(s2.Strings ,0,2);
st2:= ansimidstr(s2.Strings ,4,2);
for j := 0 to s1.Count -1 do
begin
if pos(st1,ansimidstr(s1.Strings[j] ,9,17))>0 then
begin
b1:=b1+1;
end;
if pos(st2,ansimidstr(s1.Strings[j] ,9,17))>0 then
begin
b2:=b2+1;
end;
if (pos(st1,ansimidstr(s1.Strings[j] ,9,17))>0) and (pos(st2,ansimidstr(s1.Strings[j] ,9,17))>0) then
s := s+1;
end;
if s >=1 then
begin
v := s/(b1+b2)*2*100;
// memo11.Lines.Add(s2.Strings+' := '+formatfloat('00.000',v));
s3.Add(s2.Strings+' := '+ floattostr(SimpleRoundTo(v,-3)));
end;
end;
memo11.Clear;
memo11.Text := s3.Text;
s3.Clear;
s1.Free;
s2.Free;
s3.Free;
end;
var
i,j,k,s,b1,b2:integer;
v:real;
st1,st2:string;
s1,s2,s3:TStringList;
begin
s1:=TStringList.Create;
s2:=TStringList.Create;
s3:=TStringList.Create;
s1.Text := memo8.Text;
s2.Text := memo12.Text;
for i := 0 to s2.Count -1 do
begin
b1:=0;
b2:=0;
s:=0;
st1:= ansimidstr(s2.Strings ,0,2);
st2:= ansimidstr(s2.Strings ,4,2);
for j := 0 to s1.Count -1 do
begin
if pos(st1,ansimidstr(s1.Strings[j] ,9,17))>0 then
begin
b1:=b1+1;
end;
if pos(st2,ansimidstr(s1.Strings[j] ,9,17))>0 then
begin
b2:=b2+1;
end;
if (pos(st1,ansimidstr(s1.Strings[j] ,9,17))>0) and (pos(st2,ansimidstr(s1.Strings[j] ,9,17))>0) then
s := s+1;
end;
if s >=1 then
begin
v := s/(b1+b2)*2*100;
// memo11.Lines.Add(s2.Strings+' := '+formatfloat('00.000',v));
s3.Add(s2.Strings+' := '+ floattostr(SimpleRoundTo(v,-3)));
end;
end;
memo11.Clear;
memo11.Text := s3.Text;
s3.Clear;
s1.Free;
s2.Free;
s3.Free;
end;