This shows you the differences between two versions of the page.
en:dim [2016/08/08 10:04] admin |
en:dim [2020/02/28 10:46] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Dim (Statement) ===== | ||
- | ==== Format ==== | ||
- | |||
- | === Create a One Dimensional Array === | ||
- | |||
- | **dim** // | ||
- | **dim** // | ||
- | **dim** // | ||
- | **dim** // | ||
- | |||
- | === Create a Two Dimensional Array === | ||
- | |||
- | **dim** // | ||
- | **dim** // | ||
- | **dim** // | ||
- | **dim** // | ||
- | |||
- | === Use a List to Create and Fill an Array === | ||
- | |||
- | **dim** // | ||
- | **dim** // | ||
- | |||
- | === Copy One Array to Another === | ||
- | |||
- | **dim** // | ||
- | |||
- | === Fill an Existing Array With a Single Value ==== | ||
- | |||
- | **dim** // | ||
- | |||
- | |||
- | ==== Description ==== | ||
- | |||
- | Returns a newly created single dimensional array of length //integer// or a 2 dimensional array that can be addressed by //row// and // | ||
- | |||
- | The first element of an array has an index of 0 (zero). | ||
- | |||
- | The **dim** statement can also be used to create a new array that is a duplicate of another array. | ||
- | |||
- | ==== Example ==== | ||
- | |||
- | < | ||
- | dim z = {1, 2, 3, 4, 5} | ||
- | print z[0] + " " + z[4] | ||
- | </ | ||
- | will print | ||
- | < | ||
- | 1 5 | ||
- | </ | ||
- | |||
- | ==== Example Two ==== | ||
- | < | ||
- | dim c(4) | ||
- | c[0] = " | ||
- | c[1] = " | ||
- | c[2] = " | ||
- | c[3] = " | ||
- | print c[2] + " " + c[3] + " "; | ||
- | print c[1] + " " + c[0] + "?" | ||
- | </ | ||
- | will print | ||
- | < | ||
- | how now brown cow? | ||
- | </ | ||
- | |||
- | ==== See Also ==== | ||
- | {{page> | ||
- | |||
- | ==== History ==== | ||
- | |1.99.99.55|Cleaned up documentation and added array copy.| |