This shows you the differences between two versions of the page.
pt:dim [2016/01/01 22:47] |
pt:dim [2020/02/28 10:46] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Dim ===== | ||
+ | |||
+ | ==== Formato ==== | ||
+ | |||
+ | **dim** // | ||
+ | **dim** // | ||
+ | **dim** // | ||
+ | **dim** // | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== Descrição ==== | ||
+ | |||
+ | Cria um array (vector) unidimensional de com //n// elementos ou bidimensional // linha x coluna //. Os arrays podem conter números ou cadeias alfanuméricas " | ||
+ | |||
+ | ==== Ver também==== | ||
+ | |||
+ | {{page> | ||
+ | |||
+ | |||
+ | ==== Exemplo 1 ==== | ||
+ | |||
+ | < | ||
+ | dim z(5) | ||
+ | z = {1, 2, 3, 4, 5} | ||
+ | print z[0] + " " + z[4] | ||
+ | </ | ||
+ | will print | ||
+ | < | ||
+ | 1 5 | ||
+ | </ | ||
+ | |||
+ | ==== Exemplo 2 ==== | ||
+ | < | ||
+ | dim c$(4) | ||
+ | c$ = {" | ||
+ | print c$[2] + " " + c$[3] + " "; | ||
+ | print c$[1] + " " + c$[0] + "?" | ||
+ | </ | ||
+ | will print | ||
+ | < | ||
+ | how now brown cow? | ||
+ | </ | ||
+ | |||