Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introducedin
09.1

Description

Excerpt

The ComputationResult FunctionValue class is used to pass arguments in and get results from custom functions.

Signature
C#
C#
 public class ComputationResultFunctionValue
Signature
vb.net
vb.net
Public Class ComputationResultFunctionValue
Example
Code Block
csharp
csharp
titleC#
//public CreateFunctionValue a computation result for a string
ComputationResult CustomFunction(IList<FunctionValue> args, Cell currentCell)
{
    StringBuilder result = new ComputationResultStringBuilder("Hello");
    
    // Iterate over the list of FunctionValues passed in
    foreach (FunctionValue arg in args)
        if (arg.Type != FunctionValueType.RANGE)
            result.Append(arg.Value);
    
    // Create a new FunctionValue to return as the result
    return new FunctionValue(result.ToString());
}
Code Block
vbnet
vbnet
titlevb.net
'Public CreateFunction aCustomFunction(args computationAs result for a string
IList(Of FunctionValue), currentCell As Cell) As FunctionValue
	Dim result asAs New ComputationResultStringBuilder("Hello")")

    ' Iterate over the list of FunctionValues passed in
	For Each arg As FunctionValue In args
		If arg.Type <> FunctionValueType.RANGE Then
			result.Append(arg.Value)
		End If
	Next

    ' Create a new FunctionValue to return as the result
	Return New FunctionValue(result.ToString())
End Function

Properties

Name

Description

Value

Excerpt Include
ComputationResultFunctionValue.ValueComputationResult
FunctionValue.Value
nopaneltrue

Type

Excerpt Include
ComputationResultFunctionValue.TypeComputationResult
FunctionValue.Type
nopaneltrue

Classesconstructors

Name

Description

ComputationResultTypeFunctionValue(String)

Excerpt Include
ComputationResultTypeComputationResultTypeFunctionValue.FunctionValue(String)
FunctionValue.FunctionValue(String)
nopaneltrue

FunctionValue(Boolean)

Excerpt Include
FunctionValue.FunctionValue(Boolean)
FunctionValue.FunctionValue(Boolean)
nopaneltrue
FunctionValue(Double)
Excerpt Include
FunctionValue.FunctionValue(Double)
FunctionValue.FunctionValue(Double)
nopaneltrue
FunctionValue(Range)
Excerpt Include
FunctionValue.FunctionValue(Range)
FunctionValue.FunctionValue(Range)
nopaneltrue

Values

Name

Description

FunctionValue.Null

A static FunctionValue representing null.
FunctionValue.TrueA static FunctionValue representing true.
FunctionValue.FalseA static FunctionValue representing false.
FunctionValue.Div0ErrorOccurs when a number is divided either by zero (0) or by a cell that contains no value.
FunctionValue.ValueErrorOccurs when incorrect value type was passed into a function.
FunctionValue.NameErrorOccurs when text in a formula is not recognized.
FunctionValue.NumErrorOccurs with invalid numeric values in a formula or function.
FunctionValue.NullErrorOccurs when you specify an intersection of two areas that do not intersect.
FunctionValue.RefErrorOccurs when a cell reference is not valid.
FunctionValue.NAErrorOccurs when a value is not available to a function or formula.