Click or drag to resize

ArrayInit Function

Create an initialized array.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.07
Syntax
 FUNCTION ArrayInit(
	wElements AS DWORD,
	avalues REF USUAL[]
) AS ARRAY
View Source

Parameters

wElements
Type: UInt32
The number of elements.
avalues
Type: Usual

Return Value

Type: Array
An initialized array with the specified number of elements and referenced values in each element.
Remarks
ArrayInit() builds an array with the specified number of elements and initializes the elements with the pointer contents.  At least <wElements> data of type USUAL must be at the location referenced by <>.  To create an uninitialized array, see ArrayNew().
Examples
This example creates and initializes a 2-element array.  An existing DIM array serves as the pointer to the initialized data:
X#
FUNCTION Start()
        LOCAL aOffsets AS ARRAY
        LOCAL DIM aDimPoint[2] AS USUAL
        aDimPoint[1] := "Hello"
        aDimPoint[2] := "World!"
        aOffsets := ArrayInit(2, @aDimPoint)
See Also