This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:arrays [2016/09/08 19:32] admin |
en:arrays [2020/04/21 18:29] (current) admin |
||
---|---|---|---|
Line 2: | Line 2: | ||
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]]. | ||
[[arraylength|Array lengths]] may also be extracted using [?] [?,] and [,?] on the end of the array variable. | [[arraylength|Array lengths]] may also be extracted using [?] [?,] and [,?] on the end of the array variable. | ||
+ | |||
+ | By default arrays may be indexed using an integer in the range of 0 to array_length-1. | ||
==== Assigning values to an array ==== | ==== Assigning values to an array ==== | ||
Line 27: | Line 29: | ||
< | < | ||
a = {1,2,3,4} | a = {1,2,3,4} | ||
- | dim b = a | + | dim b = a[] |
</ | </ | ||
Line 42: | Line 44: | ||
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 may 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| | ||
+ | |2.0.0.0|Added ability to change array base| |