Files
mql5-skills/skills/mql5/references/docs/34-standardlibrary/1507-standardlibrary-cobject-cobjectsetprev.md
T
2026-06-23 21:47:51 +08:00

52 lines
1.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Prev
Sets the pointer to the previous element in the list.
```
void  Prev(
   CObject*  object      // Pointer to the previous element in the list
   )
```
Parameters
object
[in]  New value of the pointer to the previous element in the list.
Example:
```
//--- example for CObject::Prev(CObject*)
#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;
     }
   //--- set interconnect
   object_first.Next(object_second);
   object_second.Prev(object_first);
   //--- use objects
   //--- ...
   //--- delete objects
   delete object_first;
   delete object_second;
  }
```