|
Post by Sprout on Jul 7, 2020 20:27:11 GMT
Hello, I am very new to Just BASIC. I don't know how to explain this, but is there a way to do the code below?
a0 = 0
a1 = 0
a2 = 0
a3 = 0
i = 0
for i = 0 to 3
a[i] = a[i] + 1
next
|
|
|
Post by Sprout on Jul 7, 2020 20:30:02 GMT
Sorry about the horrible formatting, I haven't quite learned how to manually type code with the "insert code" box.
|
|
|
Post by B+ on Jul 7, 2020 21:05:39 GMT
Well hello hello! loops are good for filling arrays dim a(20) ' <<<< a can index 20 values (OK it's 21 I forget a(0) makes 21 items)
for i = 1 to 20 a(i) = i 'load i into a(index = i) next
'see for i = 1 to 20 print a(i) next
Below is location of code tag button in forum editor. The idea is to put the code between [ code ] insert code here [ /code ] with a copy and then paste operation. Oh BTW Square brackets [ ] here are for line labels, arrays (and functions) use ()'s Attachments:
|
|
|
Post by Sprout on Jul 8, 2020 1:04:59 GMT
Thank you! This makes life much easier.
|
|
|
Post by cundo on Jul 8, 2020 1:41:03 GMT
Ha! good one on the hello hello
|
|