Would someone be willing to provide a simple capx that searches a 3D array for a value and returns the location of the value. I would be REALLY appreciative. Thank you.
Develop games in your browser. Powerful, performant & highly capable.
You just have to add a third for loop there, for the Z variable, since it's a 3D array.
Also, jhjconstruct, it would be good to know what do you want to do with these indexes, because they may be returned as variables, as a string, as array elements and even as instance variables of the array you're searching. Depending on what you plan some options are better than others.
Good point, brunopalermo , thanks! For some reason I thought array[x,y] is a 3D array
I found a much easier way to do this and it works with arrays of any dimensions:
The only problem is that Stop Loop doesn't work there. But of course there are other ways to stop searching after first match.
Thank you, Bruno and dop, REALLY a big Thanx!