Files
mql5-skills/skills/mql5/references/docs/34-standardlibrary/1731-standardlibrary-datastructures-carraystring-carraystringdelete.md
T
2026-06-23 21:47:51 +08:00

51 lines
852 B
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Delete
Removes the element from the specified array position.
```
bool  Delete(
   int  pos      // position
   )
```
Parameters
pos
[in]  Position of the array element to be removed.
Return Value
true - successful, false - cannot remove the element.
Example:
```
//--- example for CArrayString::Delete(int)
#include <Arrays\ArrayString.mqh>
//---
void OnStart()
  {
   CArrayString *array=new CArrayString;
   //---
   if(array==NULL)
     {
      printf("Object create error");
      return;
     }
   //--- add arrays elements
   //--- . . .
   //--- delete element
   if(!array.Delete(0))
     {
      printf("Delete error");
      delete array;
      return;
     }
   //--- delete array
   delete array;
  }
```