25.01.2011, 10:04
|
Прохожий
|
|
Регистрация: 24.01.2011
Сообщения: 26
Репутация: 10
|
|
Будьте добры, подскажите, где в моём коде ошибка при занесении выбранного движка в StringGrid. Заранее благодарю!
Код:
procedure TForm1.Button1Click(Sender: TObject);
var Pnom:Real;
begin
Pnom:=StrToFloat(Edit3.Text);
if Table1.Filter = ''
then Table1.Filter := 'Pnom >= ' + Edit3.Text
else Table1.Filter := Table1.Filter + ' and Pnom >= ' + Edit3.Text;
Table1.Filtered := True;
end;
var Pnom:Real; i,j:integer;
begin
for i:=0 to 8 do for j:=1 to 100 do StringGrid1.Cells[i,j]:='';
Table1.First;
j:=1;
for i:=1 to Table1.RecordCount do
begin
Pnom:=0;
if Pnom then begin
StringGrid1.Cells[0,j]:=Table1.FieldValues['Tiporazmer'];
StringGrid1.Cells[1,j]:=Table1.FieldValues['Pnom'];
StringGrid1.Cells[2,j]:=FloatToStrF(Table1.FieldValues['Inom'],ffFixed,4,1);
StringGrid1.Cells[3,j]:=FloatToStrF(Table1.FieldValues['KPD'],ffFixed,5,1);
StringGrid1.Cells[4,j]:=FloatToStrF(Table1.FieldValues['cos f'],ffFixed,4,1);
StringGrid1.Cells[5,j]:=FloatToStrF(Table1.FieldValues['Ip/In'],ffFixed,4,1);
StringGrid1.Cells[6,j]:=FloatToStrF(Table1.FieldValues['Mp/Mn'],ffFixed,4,1);
StringGrid1.Cells[7,j]:=FloatToStrF(Table1.FieldValues['Mmax/Mn'],ffFixed,4,1);
StringGrid1.Cells[8,j]:=FloatToStrF(Table1.FieldValues['N'],ffFixed,4,1);
j:=j+1;
end; {if}
Table1.Next;
end;
end;
end.
Админ: Пользуемся тегами для оформления кода!
|