Darwin Help

Back to Index

CreateArray

Function CreateArray - Creates an array of defined length and initialization

Calling Sequence  CreateArray(1..n1,1..n2,1..nk)
CreateArray(1..k,z)
Parameters
NameTypeDescription

ni integerinteger dimensions of the array
k integerinteger dimension of the array
z anythinginitialization value of the array
Return Type  list
Synopsis This function creates a new array of dimension specified by k. If the last argument to CreateArray is not of type range, this is the initial value assigned to each element of the array.
Examples
> x := CreateArray(1..5, 4);
x := [4, 4, 4, 4, 4]
> y := CreateArray(1..2, 1..2, [3,4]);
y := [[[3, 4], [3, 4]], [[3, 4], [3, 4]]]


See also CreateString