Показать сообщение отдельно
  #4  
Старый 11.02.2018, 14:13
DrInfinity DrInfinity вне форума
Прохожий
 
Регистрация: 09.02.2018
Сообщения: 6
Версия Delphi: Delphi 7
Репутация: 10
По умолчанию

получилось! может кому пригодится.

Код:
procedure TForm1.Button3Click(Sender: TObject); //ïîèñê áöí
var
  i : integer;
  k : integer;
  y : integer;
  b : integer;
  e : integer;
begin
for e := 1 to TrackBar3.Position do
for b := 1 to TrackBar1.Position do
for k := 1 to stringgrid2.ColCount-1 do
for i := 1 to stringgrid1.RowCount-1 do
if (stringgrid2.Cells[k,0]<>'') and (stringgrid1.Cells[1,i]<>'') then
if (abs((strtofloat(stringgrid1.Cells[1,i]))-(strtofloat(stringgrid2.Cells[k,0])))<=(strtofloat(inttostr(b))*0.1)) then
for y := 1 to stringgrid2.RowCount-1 do
if (stringgrid2.Cells[0,y]<>'') then
if (abs((strtofloat(stringgrid1.Cells[0,i]))-(strtofloat(stringgrid2.Cells[0,y])))<=(strtofloat(inttostr(e)))) then
begin
Edit2.Text:=inttostr(y);
Edit1.Text:=inttostr(i);
if stringgrid2.Cells[k,y]='' then
stringgrid2.Cells[k,y]:=stringgrid1.Cells[2,i];  break;
end;
end;
Ответить с цитированием