MAKE_ARRAY

The MAKE_ARRAY function returns an array of the specified type, dimensions, and initialization. This function enables you to dynamically create an array whose characteristics are not known until run time.

Calling Sequence

Result = MAKE_ARRAY( [D 1 , ..., D n ] )

Arguments

D i

The dimensions of the result. The dimension parameters can be any scalar expression. Up to eight dimensions can be specified.

Keywords

BYTE

Set this keyword to create a byte array.

COMPLEX

Set this keyword to create a complex, single-precision, floating-point array.

DCOMPLEX

Set this keyword to create a complex, double-precision, floating-point array.

DIMENSION

A vector of 1 to 8 elements specifying the dimensions of the result.

DOUBLE

Set this keyword to create a double-precision, floating-point array.

FLOAT

Set this keyword to create a single-precision, floating-point array.

INDEX

Set this keyword to initialize the array with each element set to the value of its one-dimensional subscript.

INT

Set this keyword to create an integer array.

LONG

Set this keyword to create a longword integer array.

NOZERO

Set this keyword to prevent the initialization of the array. Normally, each element of the resulting array is set to zero.

OBJ

Set this keyword to create an object reference array.

PTR

Set this keyword to create a pointer array.

SIZE

A size vector specifying the type and dimensions of the result. The format of a size vector is given in the description of the SIZE function.

STRING

Set this keyword to create a string array.

TYPE

The type code to set the type of the result. See the description of the SIZE function for a list of IDL type codes.

VALUE

The value to initialize each element of the resulting array. VALUE can be a scalar of any type including structure types. The result type is taken from VALUE unless one of the other keywords that specify a type is also set. In that case, VALUE is converted to the type specified by the other keyword prior to initializing the resulting array.

Example

To create M, a 3-element by 4-element, integer array with each element set to the value 5, enter:

M = MAKE_ARRAY(3, 4, /INTEGER, VALUE = 5)

See Also

BYTARR , COMPLEXARR , DBLARR , DCOMPLEXARR , FLTARR , INTARR , , REPLICATE , STRARR