Results 1 to 6 of 6

Thread: An Array Indexes Question

  1. #1
    DaveBoom
    Guest
    If I have an Array of 1..10, 1..20
    and this Array simbolizes the location of a player on the board how can i retrive the slot the player is right now.

    What I do know how to do is to follow the player from the beginnig and saving his location to two different variables.

    10x David

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    ???
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3
    Lively Member
    Join Date
    Aug 2000
    Location
    Darlington, United Kingdom
    Posts
    121
    I'm assuming that this array is declared as boolean??

    Code:
    Dim i As Byte, j As Byte, Found As Boolean
    i = 1
    While Found = False
        For j= 1 To 20
            If PlayerIsHere(i,j) = True Then
                Found = True
                Exit For
            End If
        Next J
        If Found = False Then i = i +1
    Wend
    MsgBox "Player is at cell " &i &"," &"j"
    Any Help
    Do Not Underestimate The Power Of Simple VBA

    Maybe Its Just Not Possible, But Then Again What Is Impossible

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    how on earth did you understand the question!!??



    (No Offense Dave)
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5
    Lively Member
    Join Date
    Aug 2000
    Location
    Darlington, United Kingdom
    Posts
    121
    Do a lot of work with arrays
    Do Not Underestimate The Power Of Simple VBA

    Maybe Its Just Not Possible, But Then Again What Is Impossible

  6. #6
    Guest

    10x alot

    and sorry english is only a third language for me, so id dont make myself clear enough

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