GetNodeAtIndex

Obtém um item com o índice determinado da lista.

CObject*  GetNodeAtIndex(
   int  pos      // position
   )

Parâmetros

pos

[in]  índice do item na lista.

Valor de retorno

Ponteiro para o item em caso de sucesso. NULL, se não pode obter um ponteiro.

Exemplo

//--- example for CList::GetNodeAtIndex(int)  
#include <Arrays\List.mqh>  
//---  
void OnStart()  
  {  
   CList *list=new CList;  
   //---  
   if(list==NULL)  
     {  
      printf("Object create error");  
      return;  
     }  
   //--- add list elements  
   //--- . . .  
   CObject *object=list.GetNodeAtIndex(10);  
   if(object==NULL)  
     {  
      printf("Get node error");  
      delete list;  
      return;  
     }  
   //--- use element  
   //--- . . .  
   //--- do not delete element  
   //--- delete list  
   delete list;  
  }