Hb_ADel Function | |
Delete an element from an array and optionally adjust the length of the array.
Namespace:
XSharp.Harbour
Assembly:
XSharp.Harbour (in XSharp.Harbour.dll) Version: 2.19
Syntax FUNCTION Hb_ADel(
aArray,
nPos,
lAutoSize
) AS ARRAY CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static Array Hb_ADel(
Usual aArray = default,
Usual nPos = default,
Usual lAutoSize = default
)
Request Example
View SourceParameters
- aArray (Optional)
- Type: Usual
Name of array from which an element is to be removed. - nPos (Optional)
- Type: Usual
Subscript of the element to be removed. Default value: 1. - lAutoSize (Optional)
- Type: Usual
Logic flag specifying if the array will be resized or not. Default value: .F. (no resize).
Return Value
Type:
ArrayThe changed array
Remarks
This function deletes the element value (not the element itself!) stored in position nPos and
shifts all the following values, one position up.
If lAutoSize is .T., then the last element is removed and the size of the array is
decreased by one, otherwise the length of the array remains unchanged and a NIL value
will be stored in the last element, just like in ADel().
Examples 1LOCAL aArray := {1,2,3,4}
2hb_ADel( aArray, 2 )
3? Alen(aArray)
4? ATail(aArray)
5hb_ADel( aArray, 2, .T. )
6? Alen(aArray)
7? ATail(aArray)
See Also