Dimensions()

Create and size an Open GENIE array

DIMENSIONS() dim1=Integer [dim2=Integer] ... [dim10=Integer] Create an empty array

example:

	# Dimension a 1 x 2 x 3 array
	>> a = dimensions(1, 2, 3)
	>> printn is_a(a, "Realarray")
	$FALSE
	>> a[1,2,1] = 4.0
	>> printn is_a(a, "Realarray")
	$TRUE
	>> printn a
	[_ _ _ 4.0 _ ...] Array(1 2 3 )

Note: Arrays print as if they are one dimensional (in row major order).

Dimensions

The dimensions command is used for creating arrays of a specified length and dimensionality. The number of "dim" parameters specified gives the dimensionality and the values give the length of each dimension. In Open GENIE arrays always start at 1.

Until a value has been assigned to one element of the array, the array has no fixed type and it will take on the type of the first value assigned to one of its elements. After this, trying to assign a different type will create an error as arrays may only contain variables of one type. Elements in an array that are undefined are shown as an "_" character. Undefined values in arrays can be changed to fixed values using the Fix() command.

Parameters:

Dim1, ..., Dim10 (Integer)

Sizes of each array dimension.

RESULT = (Array)

An array of the correct size and dimensionality but with an as yet undecided type.