Reconstruct

This page in 2003
Top  Previous  Next

The Reformulate method is the only one offered by IOAKAPI which does not correspond with a command offered by the OAK user interface.

OAK's facilities to optimize, prune, dename and reconstruct a formula all involve parsing (that is, interpreting) the expression involved, applying some transformations, and writing out the revised expression.  In a reconstruction, the revised expression is written on a new workbook, but in all other cases, the expression is written back to the original formula location.  So a formula denamed by OAK Development | Names | Deapply, or simplified algebraically by OAK Development | Formula | Optimize, can be thought of as an in-place reconstruction of that formula.

The Reformulate method exposes this mechanism for general use.  With the appropriate choice of parameters, many of OAK's optimizing, denaming, pruning and reconstruction methods can be synthesized from it.  The method is offered for use by experts who may wish to use other combinations of parameters to build up their own applications of this technology for manipulating and gaining insight into spreadsheet calculations.

Applies to

IOAKAPI

SYNTAX

expression.Reformulate(Range1, DelinkMode1, OptimizationMode1, PruningMode1, additionsOnly, sumExpansionLimit, maxDepth)

expression   Required.  An expression that returns an IOAKAPI object.

Range1           Required Range.  The cells containing the calculation to be reconstructed.

DelinkMode1   Required DelinkMode. One of DelinkMode_ConstantFormula, DelinkMode_Constants, DelinkMode_Everything, DelinkMode_Formula, DelinkMode_NonConstantFormula, DelinkModeNone.  Delinking is what distinguishes an Optimized expression, written back to its original location and referring to its original precedents, from a Reconstruction, in which a formula is written to a new location, and is altered so that it refers to its precedents indirectly through new cells.  Documentation of this parameter is available from Operis

OptimizationMode1 Required OptimizationMode: One of OptimizationMode_Aggressive or OptimizationMode_Conservative

PruningMode1   Required PruningMode. Specifies what, if any, pruning is performed on functions encountered during the analysis of precedent formulas.

additionsOnly        Required Boolean. Instructs OAK to perform precedent substitution only to the extent that the result is a formula that contains +, - and SUM.  Equivalent to the Confine to additions option in the dialog box presented when the user interface version of the Reconstruct command is activated.

sumExpansionLimit   Required Long. Instructs OAK to expand any SUM() function which acts on this number or fewer cells that is, convert from SUM(A1:A3) to A1+A2+A3.

maxDepth   Required Long. Indicates how many levels of precedent substitution are to be attempted.

Remarks

Since it has no analog in the OAK user interface, no version of this method is offered for the IOAKAddIn object.