question on BASICally array usage

Do you get -3.1 on OUT3?

cx[21]={
-3.2,0, ' 0
-3.1,1, ' 1
-3.0,2, ' 2
-2.9,3, ' 3
-2.8,4, ' 4
-2.7,5, ' 5
-2.6,6, ' 6
-2.5,7, ' 7
-2.4,8, ' 8
-2.3,9, ' 9
-4.04}

out3=cx[2]

Zero is what I expect. I understand what you meant, but BASICally didn’t.

For the form:

foo[bar] = {2,3,5,7}

bar is not the length, as you imagined, but the index into foo of the first item. So

foo[4] = {5, -6}

on an otherwise empty foo would set foo[4] to 5 and foo[5] to -6.

Would mean that foo[4] is set to 5

Silly me… :roll_eyes:

1 Like