Hi Sieghard,

   Your answer  deserves to be applied but my  firebird data fields to be sumed 
are either  integer  (16,32,64 bits)  or numeric (x,y).  Numeric (x,y)  is 
compatible with  currency Var.

Regards

Med


________________________________
De : Sieghard <s_c_...@arcor.de>
Envoyé : jeudi 20 mai 2021 10:30
À : mseide-msegui-talk@lists.sourceforge.net 
<mseide-msegui-talk@lists.sourceforge.net>
Objet : Re: [MSEide-MSEgui-talk] BufDataset

On Tue, 18 May 2021 11:30:32 -0700 (MST)
fredvs <fi...@hotmail.com> wrote:

> (But I like your first peace of code too.)

Well, let that second piece rest in peace, rather...

> For the new code, maybe using a variant variable and create a new
> sumfield() procedure:

Yes, that might be a more general solution. It's maybe a bit clumsy
because of the neccessary _explicit_ coercion conversions, but it will
probabely work in all cases, or can be made to do so.

> procedure tmsebufdataset.sumfield(const afield: tfield; out asum:
> variant);
>
> But for this, we need a variant-guru (I am beginner in variant type).

Well, I'm definitively _not_ one - I even depise variants and avoid
them where possible. Variants are really not a data type, at least not
a _simple_ one. They are rather complex records containing a variant
part for the real data, preceded by a description of what it entails.
And this description has to be provided by the issuer, when a variant
is built. Although this can be done implicitely by the compiler at
times, i.e. if it can predetermine what the variant is meant to contain.

--
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
-----------------------------------------------------------
Mit freundlichen Grüßen, S. Schicktanz
-----------------------------------------------------------



_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to