Normally, you could have a single variable called for instance DataX:
With arrays, you can enumerate this variable:
You could do this instead:
It would do the same, however, with a 'Dim' array, you can use another variable as the index:
With a For..Next loop, the program loops a variable between a start and an end value
So, combine those two methods and you can fill an array with numbers:
Types are a more advanced method of storing/looping through data. However 'Dim' arrays are a standard feature of Basic languages and in some situations, they could come in handy.
DataX = 1
With arrays, you can enumerate this variable:
Dim DataX(3) DataX(0) = 1 DataX(1) = 999 DataX(2) = 34 DataX(3) = 123
You could do this instead:
DataX0 = 1 DataX1 = 999 DataX2 = 34 DataX3 = 123
It would do the same, however, with a 'Dim' array, you can use another variable as the index:
p = 1 DataX(p) = 999
With a For..Next loop, the program loops a variable between a start and an end value
For p = 0 to 3 print p Next
So, combine those two methods and you can fill an array with numbers:
Dim DataX(3) For p = 0 to 3 DataX(p) = 999 Next for p = 0 to 3 Print "DataX("+p+") = " + DataX(p) next
Types are a more advanced method of storing/looping through data. However 'Dim' arrays are a standard feature of Basic languages and in some situations, they could come in handy.