IndexOf
Gets the index of the specified list element.
int IndexOf(
CObject* element
)
|
Parameters
element
[in] pointer to the list element.
Return Value
Example:
//--- example for CList::IndexOf(CObject*)
#include <Arrays\List.mqh>
//---
void OnStart()
{
CList *list=new CList;
//---
if(list==NULL)
{
printf("Object create error");
return;
}
CObject *object=new CObject;
if(object==NULL)
{
printf("Element create error");
delete list;
return;
}
if(list.Add(object))
{
int pos=list.IndexOf(object);
}
//--- delete list
delete list;
}
|