GetNodeAtIndex

리스트의 지정된 위치에서 요소를 가져옵니다.

CObject*  GetNodeAtIndex(
   int  pos      // 위치
   )

Parameters

pos

[in]  목록에서의 요소 위치.

Return Value

요소에 대한 포인터 - 성공, Null - 포인터를 가져올 수 없음.

예제:

//--- CList::GetNodeAtIndex(int) 예제  
#include <Arrays\List.mqh>  
//---  
void OnStart()  
  {  
   CList *list=new CList;  
   //---  
   if(list==NULL)  
     {  
      printf("객체 생성 오류");  
      return;  
     }  
   //--- 목록 요소 추가  
   //--- . . .  
   CObject *object=list.GetNodeAtIndex(10);  
   if(object==NULL)  
     {  
      printf("노드 오류 가져오기");  
      delete list;  
      return;  
     }  
   //--- 요소 사용  
   //--- . . .  
   //--- 요소를 삭제하지 마십시오  
   //--- 목록 삭제  
   delete list;  
  }