Executes a code block that computes the value of the function.

Namespace: csmic
Assembly: csmic (in csmic.dll) Version: (


 C#  Visual Basic  Visual C++ 
decimal Execute(
	params decimal[] args
Function Execute ( _
	ParamArray args As Decimal() _
) As Decimal
Decimal Execute(
	... array<Decimal>^ args


An array of arguments passed to the function.

Return Value

The decimal value computed by the function.


Any code block is valid. Error handling must be done by the developer, as the inputInterpreter cannot determine if there is an error.


This example shows how to implement the sine function through the interface's Execute() function.
 public decimal Execute(params decimal[] args)
    //Set up an output variable.
    decimal output = 0;

    //Check to see if the number or arguments recieved 
    //is equal to the number of arguments expected.
    if (args.Length == this.NumExpectedArguments)
        //Grab the argument and set a local variable for clarity.
        decimal input = args[0];

        //Set the output as a sine of the input.
        output = (decimal)Math.Sin((double)input);

    //Return the output. The function will return the sine if the arguments 
    //matched what was expected, and will return 0 otherwise. Returning 0 on 
    //errors is the standard in CS-MIC.
    return output;

See Also