Based on what I’ve read elsewhere in the forum http://www.scidb.org/forum/viewtopic.php?f=15&t=490, it appears that functions can only return scalar values. So far whenever I’ve run into what appears to be a limiting design like this, I have subsequently understood that there is a good reason for it (i.e. great job designing a product that makes sense!). But this one I don’t entirely understand. Is there some reason to restrict functions to returning scalars? Why not allow them to return UDTs? I.e. why not allow them to return anything that fits in a single slot of an attribute?
I am in a situation where I need to apply() a fitting function, but I can only pull out one kind of result out of it for every call of apply(). So I have to do one apply() to get the fitting error, and one apply() for each fitted coefficient that I need to pull out. It seems logical to me to want to shove all the fitting results into a UDT and get them out of a single call to apply(). Just in case this was undocumented but possible, I did code it up. It compiled and loaded, but calling apply() on a function returning a UDT (which, by your definition, is not a function, but rather a “converter”, right?) failed.
Just trying to gain some insight here…