You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
isEscPressed() function to allow aborting long-running functions.
abortOnEscape(true); to check for escape and abort if so so you don't need to check within a loop (which might not even be in your own code). not worth doing immediately if it will be a pain in neck.
threadsafe attribute if we don't already have it. excel automatically will call functions with this attribute on multiple threads. I think it's just a matter of registration options. I don't think it's easy to introspect code and tell if it's thread safe - function author has to tell our library.
volatile attribute - I think this is at registration time. if we don't already have it.
allow use of Matrices rather than [][]. if you can't make it generic matrix function than use mir arrays.
Showcase example showing integration with python using pyd.
Showcase benchmark to do something useful vs python
Showcase REST example - eg pull data from yahoo, quandl or Federal reserve FRED API
Suppose you have a function that normally returns a double - you should be able to return a string as an error message somehow. XLW uses throw to do that - not sure what makes sense for us.
implement some XLW and PyXLL examples to show ease of use.
Example: xlStats. I haven't checked - probably some error in code.
D example
importstd.algorithm:map,sum;
importstd.range:front;
@Register(ArgumentText("input range to calculate statistics for"),
HelpTopic("excel-d"),
FunctionHelp("calculates mean and variance for input array"),
ArgumentHelp(["input range to calculate statistics for"]))
autoxlStats(double[][] inTargetRange)
{
auto numCells = (inTargetRange.length >0) ?
inTargetRange.length * inTargetRange.front.length : 0;
auto means = inTargetRange.map!(row => row.sum).sum / numCells;
auto sumSquares = inTargetRange.map!( row => row.map!(cell => cell*cell).sum).sum;
return [means, sumSquares / numCells - means];
}
`Is a bit simpler than the C++ XLW example:````cpp LPXLFOPER EXCEL_EXPORT xlStats(LPXLFOPER inTargetRange) { EXCEL_BEGIN; XlfOper xlTargetRange(inTargetRange); // Temporary variables. double averageTmp = 0.0; double varianceTmp = 0.0; // Iterate over the cells in the incoming matrix. for (RW i = 0; i < xlTargetRange.rows(); ++i) { for (RW j = 0; j < xlTargetRange.columns(); ++j) { // sums the values. double value(xlTargetRange(i,j).AsDouble()); averageTmp += value; // sums the squared values. varianceTmp += value * value; } } size_t popSize = xlTargetRange.rows() * xlTargetRange.columns(); // avoid divide by zero if(popSize == 0) { THROW_XLW("Can't calculate stats on empty range"); } // Initialization of the results Array oper. XlfOper result(1, 2); // compute average. double average = averageTmp / popSize; result(0, 0) = average; // compute variance result(0, 1) = varianceTmp / popSize - average * average; return result; EXCEL_END; }`
The text was updated successfully, but these errors were encountered:
Low priority list of enhancements for some day.
I talked to Joshi (who wrote the XLW framework) years back.
https://blog.adaptiverisk.com/xll/excel/2015/01/21/xlw-part5.html
Example: xlStats. I haven't checked - probably some error in code.
D example
The text was updated successfully, but these errors were encountered: