Einzelnen Beitrag anzeigen

hoika

Registriert seit: 5. Jul 2006
Ort: Magdeburg
8.270 Beiträge
 
Delphi 10.4 Sydney
 
#11

Re: Leere Zellen in StringGrid

  Alt 8. Mai 2008, 08:13
Hallo,

hier bietet sich doch TryStrToInt an.
etwa so

Delphi-Quellcode:
var
  i_1, i_2, i_3: Integer;
  iSum: Integer;

  for iCurRow:= 1 to 16 do
  begin
    i_1:= 0;
    i_2:= 0;
    i_3:= 0;

    TryStrToInt(Grid.Cells[, iCurRow], i_1);
    TryStrToInt(Grid.Cells[, iCurRow], i_2);
    TryStrToInt(Grid.Cells[, iCurRow], i_3);

    iSum:= i_1+i_2+i_3;

    Grid.Cells[, iCurRow]:= IntToStr(iSum);
  end;

Die Cols habe ich einfach mal weggelassen.


Heiko
Heiko
  Mit Zitat antworten Zitat