Array Functions in DIAL

The array functions in DIAL create and manipulate arrays. Arrays are dynamic, ordered lists of values. Each element in an array is a value, which might be another array.

Array Function Example

The following example creates an array with three elements. It then loops through the array to write out the elements. The array is composed of three divisions of a company: Alpha Brands, Delta Brands, and Omega Brands.

a = array.new();

array.add(a,"Alpha Brands");
array.add(a,"Delta Brands");
array.add(a,"Omega Brands");

i = 1;

end = array.count(a)+1;

while (i != end) {   
	value = array.get(a,i);
	console.writeln(value);
	i=i+1;
}

console.writeln("Done!");