Click or drag to resize

HostFunctionsnewArrT Method (Int32)

Creates a host array with the specified element type.

Namespace:  Microsoft.ClearScript
Assembly:  ClearScript.Core (in ClearScript.Core.dll) Version: 7.2.4
Syntax
public Object newArr<T>(
	params int[] lengths
)

Parameters

lengths
Type: SystemInt32
One or more integers representing the array dimension lengths.

Type Parameters

T
The element type of the array to create.

Return Value

Type: Object
A new host array with the specified element type.
Remarks
For information about the mapping between host members and script-callable properties and methods, see AddHostObject.
Examples
The following code creates a 5x3 host array of strings. It assumes that an instance of ExtendedHostFunctions is exposed under the name "host" (see AddHostObject).
JavaScript
var StringT = host.type("System.String");
var array = host.newArr(StringT, 5, 3);
See Also