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("Object create error");
    return;
    }
  object_second=new CObject;
  if(object_second==NULL)
    {
    printf("Object create error");
    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;
 }