Page tree

Versions Compared

Key

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

...

Example
Code Block
csharp
csharp
titleC#
public FunctionValue CustomFunction(IList<FunctionValue> args, Cell currentCell)
{
    StringBuilder result = new StringBuilder("");
    
    // Iterate over the list of FunctionValues passed in
    foreach (FunctionValue arg in args)
        if (arg.Type != FunctionValueType.RANGE)
        {    result.Append(arg.Value);
    
    // AccessCreate thea Valuenew propertyFunctionValue andto appendreturn itas to the result
            result.Append(arg.Value);
        }
 
    return new FunctionValue(result.ToString());
}
Code Block
vbnet
vbnet
titlevb.net
Public Function CustomFunction(args As IList(Of FunctionValue), currentCell As Cell) As FunctionValue
	Dim result As New StringBuilder("")

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

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

...