Advertisement
Guest User

Untitled

a guest
Sep 25th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. procedure ChangeTable(StringGrid:TStringGrid; icol,irow:integer);
  2. var
  3. MyComponent: TComponent;
  4. n,m,Ail,Akj:double;
  5. i,j:integer;
  6. begin
  7. n:=StrToFloat(StringGrid.Cells[icol,irow]);
  8. for I := 0 to StringGrid.ColCount - 1 do
  9. begin
  10. m:=StrToFloat(StringGrid.Cells[i,irow]);
  11. m:=m/n;
  12. StringGrid.Cells[i,irow]:=FloatToStr(m);
  13. end;
  14. for i := 0 to StringGrid.RowCount - 1 do
  15. begin
  16. if i <> irow then
  17. begin
  18. StringGrid.Cells[icol,i]:='0';
  19. end;
  20. end;
  21. for I := 0 to StringGrid.ColCount - 1 do
  22. for j := 0 to StringGrid.RowCount - 1 do
  23. if (i <> icol) and (j <> irow) then
  24. begin
  25. MyComponent := Form1.FindComponent('StringGrid'+IntToStr(scount-1));
  26. if MyComponent <> nil then
  27. begin
  28. m:=StrToFloat(TStringGrid(MyComponent).Cells[i,j]);
  29. Ail:=StrToFloat(TStringGrid(MyComponent).Cells[i,irow]);
  30. Akj:=StrToFloat(TStringGrid(MyComponent).Cells[icol,j]);
  31. m:=m-Ail*Akj/n;
  32. StringGrid.Cells[i,j]:=FloatToStr(m);
  33. end;
  34. end;
  35. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement