Click or drag to resize

ADelT Function (Array OfT, UInt32)

Delete an array element.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.4a
Syntax
 FUNCTION ADel<T>(
	aTarget AS ARRAY OF<T>,
	dwPosition AS DWORD
)
WHERE T : NEW()
 AS ARRAY OF<T>
View Source

Parameters

aTarget
Type: Array OfT
The array to delete an element from.
dwPosition
Type: UInt32
The position of the element to delete.

Type Parameters

T
The type of the array elements

Return Value

Type: Array OfT
A reference to <aTarget>.
Remarks
When an element is deleted from an array, its content is lost, and all elements from that position to the end of the array are shifted up one element.
The last element in the array becomes NIL.
Examples
This example creates an array of three elements, then deletes the second element.
The third element is moved up one position, and the new third element is assigned a NIL:
X#
1LOCAL aArray
2aArray := {1, 2, 3}        // aArray is now {1, 2, 3}
3ADel(aArray, 2)            // aArray is now {1, 3, NIL}
See Also