Ok, first, if Yabasic starts at 0 you can also write
for i=0 to 2
But before, you only have to DIM the arrays at (2)[i.e. value from 0 to 2 = three values]. This will save memory, although in this case it isn't necessary I think ...
Ok, next:
What does this line do?
Code:
for i = 1 to 3:
This is a loop. Every command between FOR and NEXT is executed i-times.
FOR i=1 to 3
First run: i has got the value of 1
NEXT -> Now the value of i is increased by 1 (or alternatively by a STEP given in the FOR statement: Example: For i = 1 to 10 STEP 2)
Second run: i has now the value of 2
NEXT -> Now the value of i is increased by 1
And so on ... until the second value (in this case 3) is reached.