ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript
HostFunctions Class
HostFunctions Methods
func Method
func(Int32, Object) Method
func<T>(Int32, Object) Method

# HostFunctionsfunc(Int32, Object) Method

Creates a delegate that invokes a script function and returns its result value.
Namespace: Microsoft.ClearScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public Object func(
    	int argCount,
    	Object scriptFunc
    )

    Public Function func (
    	argCount As Integer,
    	scriptFunc As Object
    ) As Object

    public:
    Object^ func(
    	int argCount,
    	Object^ scriptFunc
    )

    member func :
            argCount : int *
            scriptFunc : Object -> Object

#### Parameters

argCount Int32
  The number of arguments to pass to the script function.
scriptFunc Object
  The script function for which to create a delegate.

#### Return Value

Object
A new delegate that invokes the specified script function and returns its result value.
Remarks

This function creates a delegate that accepts argCount arguments and returns the result of invoking scriptFunc. The type of all parameters and the return value is Object. Such a delegate is often useful in strongly typed contexts because of contravariance.

For information about the types of result values that script code can return, see Evaluate(String, Boolean, String).

See Also

#### Reference

HostFunctions Class
func Overload
Microsoft.ClearScript Namespace
funcT(Int32, Object)

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft