This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
en:arrays [2016/08/08 17:57] admin |
en:arrays [2016/11/07 06:56] admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Arrays ===== | ===== Arrays ===== | ||
Arrays are allocated using the [[DIM|DIM]] command or re-sized using [[REDIM|REDIM]]. | Arrays are allocated using the [[DIM|DIM]] command or re-sized using [[REDIM|REDIM]]. | ||
- | Array sizes may also be extracted using [?] [?,] and [,?] on the end of the array variable. | + | [[arraylength|Array lengths]] |
==== Assigning values to an array ==== | ==== Assigning values to an array ==== | ||
Line 10: | Line 10: | ||
< | < | ||
dim a(10) | dim a(10) | ||
- | for t = 0 to 9 | + | for t = 0 to a[?]-1 |
a[t] = t | a[t] = t | ||
next t | next t | ||
Line 42: | Line 42: | ||
a[] fill -1 | a[] fill -1 | ||
</ | </ | ||
+ | |||
+ | ==== Passing Arrays of Data to Builtin Functions and Statements ==== | ||
+ | |||
+ | When passing an array of data, like to the [[sound|sound]] statement, you must include an empty set of brackets [] after the variable name. This was added to reduce the confusion between a regular variable and a variable containing an array of values. | ||
==== History ==== | ==== History ==== | ||
|1.99.99.55|added dim logic to copy one array to another| | |1.99.99.55|added dim logic to copy one array to another| | ||
|1.99.99.57|added the fill assignment operator| | |1.99.99.57|added the fill assignment operator| | ||
+ | |1.99.99.72|added the array passing note| |