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

58 lines
1.1 KiB
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.
# InsertArray
Inserts elements of one array from the specified position of another array.
```
bool  InsertArray(
   const string&  src[],     // source array
   int             pos        // position
   )
```
Parameters
src[]
[in] Reference to an array used as a source of elements to insert
pos
[in] Position in the array to insert
Return Value
true - successful, false - cannot insert items.
Example:
```
//--- example for CArrayString::InsertArray(const string &[],int)
#include <Arrays\ArrayString.mqh>
//---
string src[];
//---
void OnStart()
  {
   CArrayString *array=new CArrayString;
   //---
   if(array==NULL)
     {
      printf("Object create error");
      return;
     }
   //--- insert another array
   if(!array.InsertArray(src,0))
     {
      printf("Array inserting error");
      delete array;
      return;
     }
   //--- use array
   //--- . . .
   //--- delete array
   delete array;
  }
```