The current call's arguments, as the body sees them — argument reflection.
Remarks
A declaration answers "what does this parameter mean?", and the marshaller coerces every
argument to it. That is right for the overwhelming majority of parameters. What it cannot answer
is anything about this particular call:
What did the caller write there — a value, a cell, an array, nothing at all?
What was the value BEFORE the parameter's type coerced it?
Was that empty slot an omission, or a blank cell the caller pointed at?
Excel has behaviors that turn on exactly those questions, and they cluster at the
parameters Excel declares any — where there is nothing to express as a type, because Excel
declined to express one. CUMIPMT refuses a boolean at every slot while FV coerces one at
every slot; the difference is not the values, it is that CUMIPMT's slots are any and its
body decides.
It is REFLECTION and nothing else — two questions, and no third:
Coercion is deliberately absent. A body that wants a number calls
IFormulaContext.parseAsNumber on the value this hands it — that already takes a value,
already propagates an incoming error with its identity, and already answers #VALUE! for a
boolean, which IS the rule an any slot needs. There is no coercion an index can do that a
value cannot.
Obtained from FormulaContext.getArgs(), and valid ONLY while the body that asked for it is
running. A body must not retain it across an await, a callback, or a nested evaluation — the
views are pooled by dispatch depth, so the one at your depth is handed to the next call at that
depth.
exportfunctionCUMIPMT(rate: Scalar, nper: Scalar): number { constargs = FormulaContext.getArgs(); if (args.getKindAt(0) === ValueKind.Omitted) returnFormulaError.BuiltIn.NA; // `CUMIPMT(,120,…)` constasNumber = FormulaContext.parseAsNumber(args.getRawAt(0) asScalar); // TRUE is #VALUE! // … }
The current call's arguments, as the body sees them — argument reflection.
Remarks
A declaration answers "what does this parameter mean?", and the marshaller coerces every argument to it. That is right for the overwhelming majority of parameters. What it cannot answer is anything about this particular call:
Excel has behaviors that turn on exactly those questions, and they cluster at the parameters Excel declares
any— where there is nothing to express as a type, because Excel declined to express one.CUMIPMTrefuses a boolean at every slot whileFVcoerces one at every slot; the difference is not the values, it is thatCUMIPMT's slots areanyand its body decides.It is REFLECTION and nothing else — two questions, and no third:
Coercion is deliberately absent. A body that wants a number calls IFormulaContext.parseAsNumber on the value this hands it — that already takes a value, already propagates an incoming error with its identity, and already answers
#VALUE!for a boolean, which IS the rule ananyslot needs. There is no coercion an index can do that a value cannot.Obtained from
FormulaContext.getArgs(), and valid ONLY while the body that asked for it is running. A body must not retain it across anawait, a callback, or a nested evaluation — the views are pooled by dispatch depth, so the one at your depth is handed to the next call at that depth.See
Interface
IFunctionArguments