Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Leere Zellen in StringGrid (https://www.delphipraxis.net/113440-leere-zellen-stringgrid.html)

hoika 8. Mai 2008 08:13

Re: Leere Zellen in StringGrid
 
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


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:29 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz