Tibor - I was aware that a user-defined-function could not change the value of cells other than the cell it was called from via its return value, but didn't extend that thinking to userdefinedattributes for a cell, inasmuch as changing such a property would not affect re-calculation and, therefore, should not pose any problems. So, thanks for correcting my bad assumptions!
JeJe - what is a "custom document property"?
The user-defined-function (UDF) I'm trying to convert from an Excel workbook solves a problem through iteration based on the arguments (cell ranges) it is called with. Since it has to start with a guess and then refine that guess via iteration, the number of iterations can be drastically reduced if the guess can be the result it last calculated, inasmuch as the data it is working with doesn't change much between calculations. Excel 5.0 and its VBA allows a UDF to get what was displayed in the cell at the time of the call, before the UDF then goes on to change it. That allowed my UDF to start with that value and then go on to refine it, rather than start with a guess. So far, I have not been able to find a way to get that from CALC and StarBasic, so thought maybe the userdefinedattribute might be a way. Unfortunately, it's not.
I'll mark this as SOLVED, inasmuch as Tibor answered my original question with the fact that what I was trying to do can't be done. However, I still haven't found a way to get CALC Basic to do what Excel VBA could do 30 years ago.
JeJe - what is a "custom document property"?
The user-defined-function (UDF) I'm trying to convert from an Excel workbook solves a problem through iteration based on the arguments (cell ranges) it is called with. Since it has to start with a guess and then refine that guess via iteration, the number of iterations can be drastically reduced if the guess can be the result it last calculated, inasmuch as the data it is working with doesn't change much between calculations. Excel 5.0 and its VBA allows a UDF to get what was displayed in the cell at the time of the call, before the UDF then goes on to change it. That allowed my UDF to start with that value and then go on to refine it, rather than start with a guess. So far, I have not been able to find a way to get that from CALC and StarBasic, so thought maybe the userdefinedattribute might be a way. Unfortunately, it's not.
I'll mark this as SOLVED, inasmuch as Tibor answered my original question with the fact that what I was trying to do can't be done. However, I still haven't found a way to get CALC Basic to do what Excel VBA could do 30 years ago.
Statistics: Posted by Alex6361 — Fri May 10, 2024 3:43 am