Это че вы хотели сказать вот этим?:
Код:
begin
if Form3.StringGrid2.Cells[6,i]='' then
for i:=1 to 100 do
Form3.StringGrid2.Cells[6,i]:=FloatToStr(0)
end;
Видимо должно быть так:
Код:
for i:=1 to 100
do if Form3.StringGrid2.Cells[6,i]=''
then Form3.StringGrid2.Cells[6,i]:=FloatToStr(0)
В противном случае значение i в проверках неизвестно чему равно.
Вообще можно заменить весь блок:
Код:
if Form3.StringGrid2.Cells[6,i]='' then
for i:=1 to 100 do
Form3.StringGrid2.Cells[6,i]:=FloatToStr(0)
end;
begin
if Form3.StringGrid3.Cells[3,i]='' then
for i:=1 to 100 do
Form3.StringGrid3.Cells[2,i]:=FloatToStr(0)
end;
begin
if Form3.StringGrid4.Cells[4,i]='' then
for i:=1 to 100 do
Form3.StringGrid4.Cells[4,i]:=FloatToStr(0)
end;
begin
if Form3.StringGrid5.Cells[5,i]='' then
for i:=1 to 100 do
Form3.StringGrid5.Cells[5,i]:=FloatToStr(0)
end;
на такой:
Код:
for j := 2 to 6
do for i:=1 to 100
do if Form3.StringGrid2.Cells[j,i]=''
then Form3.StringGrid2.Cells[j,i]:=FloatToStr(0)