Click or drag to resize

ArrayPut Function (Array, DWord, Usual)

X#
Write a value to an array element.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION ArrayPut(
	aTarget AS ARRAY,
	dwElement AS DWORD,
	uValue AS USUAL
) AS USUAL
Request Example View Source

Parameters

aTarget
Type: Array
The array to write to.
dwElement
Type: DWord
The number of the array element to receive the value.
uValue
Type: Usual
The value to write to the array element.

Return Value

Type: Usual
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