Download MetaTrader 5
To add comments, please log in or register
Publish your task in Freelance service and developers will execute your order.
Luis
226
Luis 2014.12.27 12:05 

Dear mql4.com users:

I want to know when an array position of a object pointer arrays han no pointer in int.

MyObject *Objects[3]

Imagine we have 4 objects inside this array

And the we delete Objects[2], and made a loop trying to find the position without pointer.

for(int i=0; i<4; i++)

   {if(Objects[i]==????) Alert("Object not found in position i");}


Can you help me find the ????

Thank you

whroeder1
13644
whroeder1 2014.12.27 13:18  
BeLikeWater:
MyObject *Objects[3]

Imagine we have 4 objects inside this array

And the we delete Objects[2], and made a loop trying to find the position without pointer.

for(int i=0; i<4; i++)

   {if(Objects[i]==????) Alert("Object not found in position i");}
  1. Array Objects only has 3 elements, can't be "4 objects inside the array."
  2. Read the docs. Learn the available functions
    for(int i=0; i<4; i++){
       if(Objects[i] != NULL 
       && CheckPointer(Objects[i]) == POINTER_INVALID
       )  Alert("Object not found in position "+String(i));
    }

Luis
226
Luis 2014.12.27 13:33  

Thank you very much.

That was what I was looking for.

Greetings

/
To add comments, please log in or register