Array

From kwiki

Jump to: navigation, search

array (DNM Script built-in variable type)

An array is a data structure that stores one or more values in a single value

This article is about a data type, see Array (function) to read about the function 'array'.

Contents

Creating arrays

//one way to create array variables:
var $SomeArray[];
//another way:
var $SomeArray=Array();
//yet another way:
var $SomeArray=Array("some string", "another string");
//adding element
$SomeArray+="some string";
$SomeArray+=33;//adding a number

Associative arrays

var $SomeArray=Array();
$SomeArray["Bob"]=34;
$SomeArray["Alice"]=14;
MessageBox($SomeArray ["Bob"]);

Multi-dimensional arrays

DNM Script does not explicitly support multi-dimensional arrays. However it allows arrays of any type of object, including arrays so two dimensional arrays can be implemented as arrays of arrays.

See also

Personal tools
konradp.com