Page tree

Versions Compared

Key

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

...

Excerpt

Calculates a custom function returning a FunctionValue given a list of ComputationResult FunctionValue arguments and the function's current Cell for context.

Signature
C#
C#
ComputationResultFunctionValue CustomFunction(IList<ComputationResult>IList<FunctionValue> args, Cell currentCell)
Signature
vb.net
vb.net
Function CustomFunction(IList<ComputationResult>IList<FunctionValue> args, Cell currentCell) As ComputationResultFunctionValue

Parameters

Param
0args

An ordered list of FunctionValue arguments that have already been fully evaluated.

Param
0currentCell

The Cell that the current function resides in to use for context sensitive operations

Returns

A ComputationResult FunctionValue that contains the resulting value of the function.

...

Example
Code Block
csharp
csharp
titleC#
    public ComputationResultFunctionValue CustomFunction(IList<ComputationResult>IList<FunctionValue> args, Cell currentCell)
    {
        StringBuilder result = new StringBuilder("");
 
 
        foreach (ComputationResultFunctionValue arg in args)
            if (arg.Type != ComputationResultTypeFunctionValueType.RANGE)
                result.Append(arg);
 
 
        return new ComputationResultFunctionValue(result.ToString());
    }
Code Block
vb.net
vb.net
titlevb.net
    Public Function CustomFunction(args As IList(Of ComputationResultFunctionValue), currentCell As Cell) As ComputationResultFunctionValue
        Dim result As New StringBuilder("")
        For Each arg As ComputationResultv In args
            If arg.Type <> ComputationResultTypeFunctionValueType.RANGE Then
                result.Append(arg)
            End If
        Next
        Return New ComputationResultFunctionValue(result.ToString())
    End Function