So far all the variables you have used can contain only one value at a time. This type of variable is a called a Simple Type variable. High-level languages such as Small Basic provide programmers with a variety of additional ways of organising data into more complex and useful structures. One of the most important is the ARRAY.
An array is a set of data items grouped together using a single identifier (variable name). Individual items in the set are accessed using an Index or pointer to a specific element in the array. The number of indexes needed to access an element of an array is called its dimension. Using one index gives us a single dimensional array using two gives us a two dimensional array, and so on. Arrays can have many dimensions but for the GCSE courses you only need to be able to use arrays with one dimension or index. These are also knows as linear lists.
As already stated, the array’s identifier (name), and an index is used to refer to each of the array’s elements.
A way to visualise how arrays work.
The image above shows an Array with the identifier: StudentNames. This array has 5 elements numbered 1 to 5. StudentNames contains the value “Anna”.
An example of the use of ARRAYs is in storing a list of names as shown above. Using an ARRAY we can access each element of it using a loop to give us the required index value. See below: