48 lines
976 B
Markdown
48 lines
976 B
Markdown
# Next
|
||
|
||
Gets a pointer to the next element in the list.
|
||
|
||
```
|
||
CObject* Next()
|
||
|
||
```
|
||
|
||
Return Value
|
||
|
||
Pointer to the next element in the list. If this is the last element in the list, return NULL.
|
||
|
||
Example:
|
||
|
||
```
|
||
//--- example for CObject::Next()
|
||
#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 next object
|
||
CObject *object=object_first.Next();
|
||
//--- delete objects
|
||
delete object_first;
|
||
delete object_second;
|
||
}
|
||
|
||
```
|