|
ArrayRemove
Removes the specified number of elements from the array starting with a specified index.
bool ArrayRemove(
|
Parameters
array[]
[in][out] Array.
start
[in] Index, starting from which the array elements are removed.
count=WHOLE_ARRAY
[in] Number of removed elements. The WHOLE_ARRAY value means removing all elements from the specified index up the end of the array.
Return Value
Returns true if successful, otherwise - false. To get information about the error, call the GetLastError() function. Possible errors:
Note
If the function is used for a fixed-size array, the array size does not change: the remaining "tail" is physically copied to the start position. For accurate understanding of how the function works, see the example below. "Physical" copying means the copied objects are not created by calling the constructor or copying operator. Instead, the binary representation of an object is copied. For this reason, you cannot apply the ArrayRemove() function to the fixed-size array containing objects with the destructor (the ERR_INVALID_ARRAY or ERR_STRUCT_WITHOBJECTS_ORCLASS error is activated). When removing such an object, the destructor should be called twice – for the original object and its copy.
You cannot remove elements from dynamic arrays designated as the indicator buffers by the SetIndexBuffer() function. This will result in the ERR_SERIES_ARRAY error. For indicator buffers, all size changing operations are performed by the terminal's executing subsystem.
Example:
//+------------------------------------------------------------------+
|
See also
ArrayInsert, ArrayCopy, ArrayResize, ArrayFree