Update

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

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

Parâmetros

pos

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

element

[in] Elemento de novo valor

Valor do Retorno

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

Exemplo

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