Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
29
Task/Arrays/BASIC256/arrays.basic
Normal file
29
Task/Arrays/BASIC256/arrays.basic
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# numeric array
|
||||
dim numbers(10)
|
||||
for t = 0 to 9
|
||||
numbers[t] = t + 1
|
||||
next t
|
||||
|
||||
# string array
|
||||
dim words$(10)
|
||||
# assigning an array with a list
|
||||
words$ = {"one","two","three","four","five","six","seven","eight","nine","ten"}
|
||||
|
||||
gosub display
|
||||
|
||||
# resize arrays (always preserves values if larger)
|
||||
redim numbers(11)
|
||||
redim words$(11)
|
||||
numbers[10] = 11
|
||||
words$[10] = "eleven"
|
||||
gosub display
|
||||
|
||||
end
|
||||
|
||||
display:
|
||||
# display arrays
|
||||
# using ? to get size of array
|
||||
for t = 0 to numbers[?]-1
|
||||
print numbers[t] + "=" + words$[t]
|
||||
next t
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue