Jump to content
Sign in to follow this  
Guest TheComputerMutt

Trouble With Arrays

Recommended Posts

Guest TheComputerMutt

Ok, not a complete Newb, but I never seem to have gotten the hang of arrays in AutoIt, and I'm having some trouble. Posted Image

The code that's causing the error...

;Declaring the positions of the tiles
Dim $TilePosX[10][10]
Dim $TilePosY[10][10]
For $XLoop = 1 to 10
    For $YLoop = 1 to 10
        $TilePosX[$XLoop][$YLoop] = 15 + (16 * ($XLoop - 1))
        $TilePosY[$XLoop][$YLoop] = 104 + (16 * ($YLoop - 1))
    Next
Next
The error...

Posted Image

What am I doing wrong?

And in case you're wondering, I'm making a bot to play MineSweeper. Not that it matters, just for something to do. You know, for fun. :)

Wait... are those arrays only from 0 to 9? I mean, that's not the error (I changed the loop to that and still got the error), but mightn't that cause another error?

-TCM

Share this post


Link to post
Share on other sites
Guest TheComputerMutt

An array of 10 elements means element 0 - 9

For $XLoop = 0 to 9

<{POST_SNAPBACK}>

You know what? I tried that before I posted, and it didn't work. What I didn't realize, is that I only fixed one of the loops. :)

Thanks for helping me regain my common sense. It works now.

-TCM

Share this post


Link to post
Share on other sites
this-is-me

What in the world did you do to make that msgbox that color? Is that an actual screenshot, or did you edit it after capturing?


Who else would I be?

Share this post


Link to post
Share on other sites
ioliver

An array of 10 elements means element 0 - 9

For $XLoop = 0 to 9

<{POST_SNAPBACK}>

Larry, please correct me if I'm wrong. I though and an array of 10 elements was 1 - 10, whith 0 being a the total count of elements in the array. Maybe it only works that way for a StingSplit().

Anyway, please let me know.

Thanks,

Ian


"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites
ioliver

Thanks Larry. That clears it up.


"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites
ezzetabi

Yeah, I am interested too. :)

What in the world did you do to make that msgbox that color? Is that an actual screenshot, or did you edit it after capturing?

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites
JSThePatriot

As am I...

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites
scriptkitty

lol I thought my monitor was going out for a second there. :)


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites
Guest TheComputerMutt

No, it's not real. :) I crossposted this from another board, and there I have the reputation of photoshopping all my uploads, most of the time with this gradient. :) I wish it were real though...

-TCM

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×