Click or drag to resize

ADelT Function (Array OfT, DWord)

X#
Delete an array element.

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

Parameters

aTarget
Type: Array OfT
The array to delete an element from.
dwPosition
Type: DWord
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