ArrayCreateT Function (DWord) | |
Create an uninitialized, one-dimensional array.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION ArrayCreate<T>(
dwElements AS DWORD
)
AS ARRAY OF<T>
public static Array Of<T> ArrayCreate<T>(
uint dwElements
)
Request Example
View SourceParameters
- dwElements
- Type: DWord
The number of elements in the array.
Type Parameters
- T
- The type of the array elements
Return Value
Type:
Array OfTRemarks
ArrayCreate() returns an uninitialized array with only one dimension.
To create uninitialized multidimensional arrays, see ArrayNew().
Examples
This example creates a one-dimensional array of five elements using ArrayCreate(), then shows the equivalent action by assigning a literal array of NIL values:
1LOCAL aArray AS ARRAY
2aArray := ArrayCreate(5)
3aArray := {NIL, NIL, NIL, NIL, NIL}
This example creates an array of numbers and puts values in the elements:
1FUNCTION Start()
2 LOCAL aArray AS ARRAY
3 aArray := ArrayCreate(3)
4 ArrayPut(aArray, 1, 1)
5 ArrayPut(aArray, 2, 10)
6 ArrayPut(aArray, 3, 100)
See Also