Click or drag to resize

ArrayPutT Function (Array OfT, UInt32, T)

Write a value to an array element.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax
 FUNCTION ArrayPut<T>(
	aTarget AS ARRAY OF<T>,
	dwElement AS DWORD,
	uValue AS T
)
WHERE T : NEW()
 AS T
View Source

Parameters

aTarget
Type: Array OfT
The array to write to.
dwElement
Type: UInt32
The number of the array element to receive the value.
uValue
Type: T
The value to write to the array element.

Type Parameters

T
The type of the array elements

Return Value

Type: T
The value assigned.
Remarks
ArrayPut() writes values to specified array elements.  If a value is already there, it is overwritten.
Examples
This example writes values to array elements:
X#
FUNCTION Start()
        LOCAL aStates[2]
        ArrayPut(aStates, 1, "Montana")
        ArrayPut(aStates, 2, "Wyoming")
        // Below we get the same result by using []
        aStates[1] := "Montana"
        aStates[2] := "Wyoming"
See Also