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

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

Syntax

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

Parameters

args
array<Decimal>[]()[][]
An array of arguments passed to the function.

Return Value

The decimal value computed by the function.

Remarks

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

Examples

This example shows how to implement the sine function through the interface's Execute() function.
CopyC#
 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