Delphi-Help

  • Increase font size
  • Default font size
  • Decrease font size
Главная Статьи Таблица строк (StringGrid) Загрузка матрицы из StringGrid

Загрузка матрицы из StringGrid

Оцените материал
(0 голосов)

Загрузка матрицы из StringGrid

function LoadToMatrix(var Grid: TStringGrid; var M: TMatr): boolean;
var
  i, j: integer;
begin
  Result := true;
  SetLength(M, Grid.ColCount, Grid.RowCount);
  i := Grid.FixedRows;
  j := Grid.FixedCols;
  while ((i <= Grid.RowCount - 1) and Result) do
    begin
      while ((j <= Grid.ColCount - 1) and Result) do
        begin
          Result := TryStrToInt(Grid.Cells[j, i], M[i,j]);
          inc(j);
        end;
      inc(i);
    end;
end;

Авторизация



Счетчики