跳至内容

GetCurrentNode

GetCurrentNode

获取当前列表项。

CObject*  GetCurrentNode()

返回值

成功时是当前列表项的指针, NULL - 如果您未能获取指针。

例如:

//--- 例程 CList::GetCurrentNode()
#include <Arrays\List.mqh>
//---
void OnStart()
  {
   CList *list=new CList;
   //---
   if(list==NULL)
     {
      printf("对象创建错误");
      return;
     }
   //--- 添加列表元素
   //--- . . .
   CObject *object=list.GetCurrentNode();
   if(object==NULL)
     {
      printf("获取节点错误");
      delete list;
      return;
     }
   //--- 使用元素
   //--- . . .
   //--- 不能删除元素
   //--- 删除列表
   delete list;
  }