User Tools

Site Tools


en:dim

This is an old revision of the document!


Dim (Statement)

Format

dim numeric_variable ( posint_expr )
dim string_variable$ ( posint_expr )
dim numeric_variable ( posint_expr , posint_expr )
dim string_variable$ ( posint_expr , posint_expr )

Description

Returns a newly created single dimensional array of length integer or a 2 dimensional array thst can be addressed by row and column. Depending on the variable assignment, a string or numerical array is created.
The first element of an array has an index of 0 (zero). Indexes range from 0 to length-1.

Example

dim z(5)
z = {1, 2, 3, 4, 5}
print z[0] + " " + z[4]

will print

1 5

Example Two

dim c$(4)
c$ = {"cow", "brow", "how", "now"}
print c$[2] + " " + c$[3] + " ";
print c$[1] + " " + c$[0] + "?"

will print

how now brown cow?

See Also

en/dim.1451713251.txt.gz · Last modified: 2020/02/28 10:46 (external edit)