Hello mohamed hamza,

Du schriebst am Sun, 23 May 2021 09:02:31 +0000:

>    Many thanks  for your help. But this does not explain why we can
> not sum integer field into a currency VAR with Martin's sumField
> Procedure?

Maybe it does, as his if statement seems to be directed toward the
distinction between integer and real (floating point) data types.
True integer values are handled differently from floats, and this may
be done because of the way the compiler handles parameter passing in
these cases. It might (in facr, it _has to_) implicitely coerce
(convert) an integer into a floating point value, while a real
floating point value could probably be passed directly. One would
have to inspect the innards of the code handling the different cases,
or even the compiler output. I didn't research this deeply, though.

The compiler's feature to discern functions by their parameter list -
overloded functions and procedures - allows many neat things, but
there are limitations to this, and your case seems to be a good
example for such a limitation:.So you might simply use that feature,
declaring TWO different overloaded sum functions, where one of them
takes an integer and the other one a currency value as the pertinent
parameter. You might just as well get fancy and declare other variants
for any other data type you want. You just _have to make sure_ that
the compiler can _always_ recognize the true type of all of the
function's parameters.

-- 
(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

Reply via email to