Update

Altera o elemento no array de posição específica.

bool  Update(
   int  pos,         // Position
   int  element      // Value
   )

Parâmetros

pos

[in]  Posição do elemento no array para alterar.

element

[in]  Novo elemento de valor

Valor do Retorno

verdadeiro se com sucesso; falso - não pode alterar o elemento.

Exemplo

//--- example for CArrayInt::Update(int,int)
#include <Arrays\ArrayInt.mqh>
//---
void OnStart()
  {
   CArrayInt *array=new CArrayInt;
   //---
   if(array==NULL)
     {
      printf("Object create error");
      return;
     }
   //--- add arrays elements
   //--- . . .
   //--- update element
   if(!array.Update(0,10000))
     {
      printf("Update error");
      delete array;
      return;
     }
   //--- delete array
   delete array;
  }