Click or drag to resize

ArrayPutT Function (Array OfT, DWord, T)

X#
Write a value to an array element.

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

Parameters

aTarget
Type: Array OfT
The array to write to.
dwElement
Type: DWord
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#
1FUNCTION Start()
2    LOCAL aStates[2]
3    ArrayPut(aStates, 1, "Montana")
4    ArrayPut(aStates, 2, "Wyoming")
5    // Below we get the same result by using []
6    aStates[1] := "Montana"
7    aStates[2] := "Wyoming"
See Also