Click or drag to resize

ATrueDel Function (Array, DWord)

X#
Delete an array element.

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

Parameters

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

Return Value

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