Compare an instance to itself in its own method?

How can I compare an instance, in this case in an array (eg myInstances[3]) to check whether it is itself in its own method.

Example (This is what I’ve been trying that hasnt been working):

Parent

myArray* = new Class;

...

myArray[j].checkSelf( myArray* );

Class

function checkSelf( a_instance ) : Boolean
{
if( a_instance == this ) return true;
}

Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp:bounce:

That was just an example code, mine acts based on whether it is true. I may dig it out if it keeps gving me problems.

I suppose I could run a loop in the parent class comparing all the instances and send the result or run based on the outcome (The array instances are grandchildren of the class I am running the method from). But I guess it doesn’t seem very elegant :stare: Thanks for the reply. Still open to suggestions, I’ll tryan out the loop idea and get back aswell