Results 1 to 4 of 4

Thread: aaron... :)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184

    Post

    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

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    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
    [email protected]
    [email protected]

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184

    Post

    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

  4. #4
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    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
    [email protected]
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width