Hi David,
You are right - those parameters are used to uniquely identify the
call, so that we can find the async / observable value when the UDF is
called by Excel and we know when to start a new calculation if an
input parameter has changed.
The second parameter to ExcelAsyncUtil.Observe can be an array too. So
your function would be implemented as
object MyFunction(string a, int b, double c, DateTime d)
{
return ExcelAsyncUtil.Observe("MyFunction", new object[] {a, b, c,
d}, () => ...);
}
For this version of Excel-DNA I've tried to get the internals of the
async/observable implementation right, not worrying so much about the
ease-of-use to the add-in developer. In future we might make something
that generates the wrapper from the inside part that is now passed as
a delegate. Your add-in could already implement such an automated
wrapper generator, and register the functions with
ExcelIntegration.RegisterMethods.
-Govert
On Mar 8, 10:24 am, DavidS <
dsh...@gmail.com> wrote:
> Hello,
>
> Are the function name and parameter variables passed to
> ExcelAsyncUtil.Observe("MyFunction", parameters, ()=> ...) used simply to
> uniquely identify the request? What is the recommended way to pass, for
> example, the following function parameters to ExcelAsyncUtil.Observe?
>
> *object MyFunction(string a, int b, double c, DateTime d)
> {
> *
> *return ExcelAsyncUtil.Observe("MyFunction", ?, () => ...);
> *
> *}
>
> *
> DavidS