Library.RegisterFunction Method

Registers a new function that returns a value, which can be called from a Yarn program.

public void RegisterFunction(string name, int parameterCount, Function implementation)

Remarks

If parameterCount is -1, the function expects to receive any number of parameters.

If a function named name already exists in this Library, it will be replaced.

Parameters

Parameter Description
string name The name of the function.
Int32 parameterCount The number of parameters that this function expects to receive.
Function implementation The Function to be invoked when the function is called.