User Tools

Site Tools


en:arrays

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
en:arrays [2016/08/07 15:37]
admin
en:arrays [2016/08/08 17:57]
admin
Line 5: Line 5:
 ==== Assigning values to an array ==== ==== Assigning values to an array ====
  
-Values may be assigned to an array in one of four ways:+Values may be assigned to an array in one of five ways:
  
 1. By using the [[dim|Dim]] statement to reserve space for the array in the computer's memory and then assigning each individual element. 1. By using the [[dim|Dim]] statement to reserve space for the array in the computer's memory and then assigning each individual element.
Line 18: Line 18:
 <code> <code>
 a = {{0,1,2},{3,4,5},{6,7,8}} a = {{0,1,2},{3,4,5},{6,7,8}}
 +</code>
 +or
 +<code>
 +b[] = {1,2,3,4}
 </code> </code>
  
Line 31: Line 35:
 </code> </code>
  
 +5. Using the [[fill|fill]] assignment operator (with or without [[dim|dim]])
 +<code>
 +dim c fill "stuff"
 +dim e[] fill 0
 +b fill ""
 +a[] fill -1
 +</code>
  
 ==== 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|
en/arrays.txt ยท Last modified: 2020/04/21 18:29 by admin