PDA

Click to See Complete Forum and Search --> : aaron... :)


Dayo312
Dec 9th, 1999, 05:08 AM
Aaron.

Ok Thankyou for the other code you gave me. but there is one more big problem. It's to do with the index of the object that I am getting the name of. the function will get the name of a object, But not the index number of that object. What could to do to the code to make it get the index. I dont know even where to start. Thankyou.

Evan

Aaron Young
Dec 9th, 1999, 05:29 AM
Why would you want the Index?
If you want to do something with the Control at the specified position, simply Modify the Function to Return a Reference to the Control itself.

To Get an Index for the Control in the Collection you would have to change the For..Each..Next Loop into a Standard For..Next Loop and use the Value of the Loop Variable, but, there's no garauntee the Index returned would be consistent between calls that use it to reference the Object.


------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net

Dayo312
Dec 9th, 1999, 06:25 AM
OK.

I Dont understand at all (sorry).
OK lemme just try really hard to explain what I want to do and then you could tell me a better way to do it, and probably help me with the code. ok? Alright..

I made a Board.. almost like a chess board with a bunch a little squares (that are actually Image controls)
These squares are a large array of 169 some images.

My Idea was to Ask the computer what squares were around it. I was going to do this my giving it the Pos on the Squarqe and then Have it add on a formula to find the squares around it.

After It found the Surrouding squares it would get the Index of those ( 1 at a time ) and decide where to move the guy.

Could I do that?

Thankyou Aaron.. Helpful as always :)

Aaron Young
Dec 9th, 1999, 08:10 AM
OK, well if they are apart of a Control Array, then you can just Return the Index Property, instead of the Name of the Control.

Change the Return Type of the Function to Integer, then set FindObject equal to Control.Index instead of Control.Name

------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net