As you see, I have marked more text.
The for(i=0; i<=5; i++) this will do so that the list will go up so we get our list to work as we want it to.
So when i = 0; menas that it will be Array 0.
And the i<=5; means that it will stop when it reach 5. (In this case it doesn't really mater that much but. We mostly like avoid lagg)
And the i++ means that we increase i that's 0 with 1 every time we press N.
Now I hope you learned how to make the Arrays.
You can also use this for threads and so on. (maps, models, visions, and more)
Nice tut. I have actually wondered how to make a menu like that easy. But now i know. I actually thought you needed more code but IW really helped us with all those unused functions...
Originally Posted by Nachos
Nice tut. I have actually wondered how to make a menu like that easy. But now i know. I actually thought you needed more code but IW really helped us with all those unused functions...
haha, well...
They use arrays too, just not so many
It's not called 'sub-arrays', the numbers inside the square braces are called the indexes. If you do not know how many items are in the array you can use the .size property/variable.
Code:
someArray = [];
someArray[0] = "Hello!";
self iPrintLnBold(someArray.size); //This will display 1 on the screen because the 0 still counts!
If you want to add more things to the array but don't know what number to use, you can do this:
Code:
someArray = [];
someArray[someArray.size] = 1; //At this point, someArray.size equals to 0
someArray[someArray.size] = 2; //At this point, someArray.size equals to 1
//At this point, someArray.size equals to 2