Prev

获取列表中前一个元素的指针。

CObject*  Prev()

返回值

列表中前一个元素的指针。如果此为首个列表项, 则返回 NULL。

例如:

//--- 例程 CObject::Prev()
#include <Object.mqh>
//---
void OnStart()
  {
   CObject *object_first,*object_second;
   //---
   object_first=new CObject;
   if(object_first==NULL)
     {
      printf("对象创建错误");
      return;
     }
   object_second=new CObject;
   if(object_second==NULL)
     {
      printf("对象创建错误");
      delete object_first;
      return;
     }
   //--- 设置关联
   object_first.Next(object_second);
   object_second.Prev(object_first);
   //--- 使用前一个对象
   CObject *object=object_second.Prev();
   //--- 删除对象
   delete object_first;
   delete object_second;
  }