Small Basic - Array Basics (featured Wiki article)
Check out this article from litdev:
What is an Array?
Any array is a variable that stores a collection of things. Usually the things stored are of the same type, perhaps a list of people's names, or the position of some sprites in a game.
An array has an index and a value for each element in the array. The index is often just a number and the value is the thing stored in the array. The notation used by Small Basic is to put the index of an array element inside square brackets.
Below is an assignment statement, where the value of an array called 'my_array' at index 1 is set to the value 5.
my_array``[``1`` ] `` = ``5
Below is a statement that uses this array item and sets the variable 'result' to be the contents of my_array[1]. After this statement result will contain the value 5.
result `` = ``my_array``[``1``]
Read the rest of the article here:
Thanks again to litdev!
- Ninja Ed
Comments
- Anonymous
May 09, 2014
Nonki and LitDev have done a great job in helping build out the Small Basic library of content on TechNet Wiki! You can see a lot of the articles here, on this portal: social.technet.microsoft.com/.../17553.wiki-small-basic-portal.aspx