GetNextNode
GetNextNode
获取下一个列表项。
CObject* GetNextNode()返回值
成功时是下一个列表项的指针, NULL - 如果您未能获取指针。
例如:
//--- 例程 CList::GetNextNode()
#include <Arrays\List.mqh>
//---
void OnStart()
{
CList *list=new CList;
//---
if(list==NULL)
{
printf("对象创建错误");
return;
}
//--- 添加列表元素
//--- . . .
CObject *object=list.GetNextNode();
if(object==NULL)
{
printf("获取节点错误");
delete list;
return;
}
//--- 使用元素
//--- . . .
//--- 不能删除元素
//--- 删除列表
delete list;
}