[]
Specifies the value type of a custom function parameter or result.
Use this enum with Parameter and CustomFunction to declare the kinds of values a custom function accepts or returns, such as numbers, text, logical values, scalar variants, or objects.
public enum FunctionValueType
Public Enum FunctionValueType
AsyncCustomFunction function = new DelayFunction();
Workbook.AddCustomFunction(function, true);
worksheet.Range["A1"].Formula = "=DELAY_SAMPLE(10)";
workbook.Calculate();
workbook.WaitForCalculationToFinish();
object delayedValue = worksheet.Range["A1"].Value;
class DelayFunction : AsyncCustomFunction
{
public DelayFunction()
: base("DELAY_SAMPLE", FunctionValueType.Number,
new Parameter[] { new Parameter(FunctionValueType.Number) })
{
}
protected override Task<object> EvaluateAsync(object[] arguments, ICalcContext context)
{
return Task.FromResult(arguments[0]);
}
}
| Name | Description |
|---|---|
| Boolean | Specifies that value of parameter is bool. |
| Number | Specifies that value of parameter is number. |
| Object | Specifies that the parameter value is an object value, including a scalar, an array, or a CalcReference.
If the parameter is |
| Text | Specifies that value of parameter is string. |
| Variant | Specifies that value of parameter is scalar (number, string, bool, CalcError, null ( |