Bigglesw0rth Posted October 1, 2011 Share Posted October 1, 2011 (edited) So I am probably going about this wrong, so I thought I'd ask. Basically I have have a simple array at the top of my page:Global $_Field7[2] = ["Dog", "Cat"] And later I have a button made that runs this for..to loop: For $ii = 7 to 14 _FieldCreation($_Field[$ii][0], $_Field[$ii][1]) Next I try to run it and it keeps saying that it is not declared. I wanted it to work like the $ii going into $_Field[1] so it would look like $_Field7[0] and $_Field7[1] . And that would be declaird, so obviously im not getting the '7' from the $ii in there correctly. What should I do to get it to work so that the $ii is put in correctly so it outputs the already declared variables? Thanks Edit: Do I need to create a new array and place my smaller arrays inside? Or is there a way to put two variables together to create a new variable?Edit#2: Looks like I should just put everything inside one large array. Id still like to know if i can combine two vars into a new already declaired var, and if there is just a better method than this. Thanks for reading my crazyness.! Edited October 1, 2011 by Bigglesw0rth Link to comment Share on other sites More sharing options...
bogQ Posted October 1, 2011 Share Posted October 1, 2011 (edited) you have 1D array declared and using 2D in loop 1D=[0]2D=[0][0] look atExample 4 for _ArrayDisplay and note that you don't have enough elements in there to loop $ii = 7 to 14 Edited October 1, 2011 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Bigglesw0rth Posted October 1, 2011 Author Share Posted October 1, 2011 (edited) Ahh, thanks I get how 2D arrays work now. First part is 'sets' and the second is number of 'elements' in each set? Awesome! Edited October 1, 2011 by Bigglesw0rth Link to comment Share on other sites More sharing options...
Unsigned Posted October 2, 2011 Share Posted October 2, 2011 Ahh, thanks I get how 2D arrays work now. First part is 'sets' and the second is number of 'elements' in each set? Awesome!Yep. An alternate way is to think of it as X and Y coordinates on a two-dimensional matrix. But you've got the idea. . Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now