Problemas con StringGrid de delphi
Publicado por Carlos Jose Marquez Guzman (11 intervenciones) el 07/06/2004 06:28:20
Tengo el siguiente codigo en delphii 6, trato de realizar la multiplicacion de matrices, al parecer el codigo de los ciclos esta correcto, pero el programa me manda una falla diciendo que '' no es un valor entero valido, ¿que estoy haciendo mal?
2: begin
SgMatrizResultado.ColCount:=SgMatriz2.ColCount;
SgMatrizResultado.RowCount:=SgMatriz1.RowCount;
for cont1:=0 to SGMatriz1.RowCount-1 do begin
for cont2:=0 to SgMatriz2.ColCount-1 do begin
//SgMatrizResultado.Cells[cont1,cont2]:=IntToStr('0');
for k:=0 to SgMatriz1.ColCount-1 do begin
SGMatrizResultado.Cells[cont1,cont2]:=IntToStr(StrToInt(SgMatrizResultado.Cells[cont1,cont2])+(StrToInt(SgMatriz1.Cells[cont1,k])* (StrToInt(SgMatriz2.Cells[k,cont2]))));
end;
end;
end;
end;
end;//Case
2: begin
SgMatrizResultado.ColCount:=SgMatriz2.ColCount;
SgMatrizResultado.RowCount:=SgMatriz1.RowCount;
for cont1:=0 to SGMatriz1.RowCount-1 do begin
for cont2:=0 to SgMatriz2.ColCount-1 do begin
//SgMatrizResultado.Cells[cont1,cont2]:=IntToStr('0');
for k:=0 to SgMatriz1.ColCount-1 do begin
SGMatrizResultado.Cells[cont1,cont2]:=IntToStr(StrToInt(SgMatrizResultado.Cells[cont1,cont2])+(StrToInt(SgMatriz1.Cells[cont1,k])* (StrToInt(SgMatriz2.Cells[k,cont2]))));
end;
end;
end;
end;
end;//Case
Valora esta pregunta


0