Hello Fred,

The blocks  B1 and B2  after  if   are  redondant that  all .    This procedure 
works well.


 if (oField.datatype = ftinteger)  then
  begin
  B1 else B2

Med
________________________________
De : fredvs <[email protected]>
Envoyé : mercredi 19 mai 2021 12:15
À : [email protected] 
<[email protected]>
Objet : Re: [MSEide-MSEgui-talk] BufDataset

>   Martin did not introduce variant_sumfield then for me it's not
recommended.

I agree and also it seems that using variant will make all the process
slower.

In the last code you give, in the first peace of code:

procedure tfrmbasePagefo.DoSum(oDbGrid: TDbwidgetgrid; iRow:integer);
VAR  n:currency; nn:integer; iCol:integer; oField:TField;
begin
with oDbGrid,oDbGrid.datalink.datasource do
for iCol:=0 to datacols.count-1 do
 with datacols[iCol]   do
 if  tag>0 then
 begin
  oField:=dataset.fields[tag-1];
  if (oField.datatype = ftinteger)  then
  begin
   tmsebufdataset(DataSet).sumfield(oField,nn);

fixrows[iRow].captions[iCol].caption:=format(tnumericField(oField).DisplayFormat,[nn]);
   end
   else
   begin
   tmsebufdataset(DataSet).sumfield(oField,n);

fixrows[iRow].captions[iCol].caption:=format(tnumericField(oField).DisplayFormat,[n]);
   end;  end; end;

For me that code is OK, what problems do you have using it?

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/


_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to