Ver Mensaje Individual
  #1  
Antiguo 24-04-2012
Avatar de PaulaGV
PaulaGV PaulaGV is offline
Miembro
NULL
 
Registrado: mar 2012
Posts: 34
Reputación: 0
PaulaGV Va por buen camino
StringGrid

hola!tengo un StringGrid y quiero sumar los elementos de cada fila y colocar es resultado en el ultimo casillero del stringGrid de cada fila respectivamente, ya intente varias veces y siempre me salta el mismo error, ademas de borrar los blancos que puedan quedar luego de ingresar cada elemento del StringGrid, yo hice esto, pero me salta el error '' is not a valid integer value:


Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
i,j,suma:integer;
begin
suma:=0;
with StringGrid1 do
begin
for j := 1 to ColCount- 1 do
Trim(Cells[1,j]);
suma:=suma+StrToInt(Cells[1,j]);
end;
StringGrid1.Cells[1,3]:=IntToStr(suma);
end;
Responder Con Cita