|
IDL Reference Guide: Procedures and Functions |
|
The MAKE_ARRAY function enables you to dynamically create an array whose characteristics are not known until run time.
Result = MAKE_ARRAY ( [D1 [, ..., D8]] [, /BYTE | , /COMPLEX | , /DCOMPLEX | , /DOUBLE | , /FLOAT | , /INTEGER | , /L64 | , /LONG | , /OBJ, | , /PTR | , /STRING | , /UINT | , /UL64 | , /ULONG] [, DIMENSION=vector] [, /INDEX] [, /NOZERO] [, SIZE=vector] [, TYPE=type_code] [, VALUE=value] )
Returns an array of the specified type, dimensions, and initialization.
Either an array or a series of scalar expressions specifying the dimensions of the result. If a single argument is specified, it can be either a scalar expression or an array of up to eight elements. If multiple arguments are specified, they must all be scalar expressions. Up to eight dimensions can be specified. If the dimension arguments are not integer values, IDL will convert them to integer values before creating the new array.
The Di arguments are optional if the dimensions of the result are specified using the DIMENSION keyword. Note that you should supply either the Di arguments or a value for the DIMENSION keyword, but not both.
Set this keyword to create a byte array.
Set this keyword to create a complex, single-precision, floating-point array.
Set this keyword to create a complex, double-precision, floating-point array.
An array of up to eight scalar elements, specifying the dimensions of the result. Note that you should supply either the Di arguments or a value for the DIMENSION keyword, but not both.
Set this keyword to create a double-precision, floating-point array.
Set this keyword to create a single-precision, floating-point array.
Set this keyword to create a 64-bit integer array.
Set this keyword to initialize the array with each element set to the value of its one-dimensional subscript.
Set this keyword to create an integer array.
Set this keyword to create a longword integer array.
Set this keyword to prevent the initialization of the array. Normally, each element of the resulting array is set to zero.
Set this keyword to create an object reference array.
Set this keyword to create a pointer array.
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.
Set this keyword to create a string array.
The type code to set the type of the result. See the description of the SIZE function for a list of IDL type codes.
| Note For structures, all type code values are valid except for TYPE=8. |
Set this keyword to create an unsigned integer array.
Set this keyword to create an unsigned 64-bit integer array.
Set this keyword to create an unsigned longword integer array.
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.
This routine is written to make use of IDL's thread pool, which can increase execution speed on systems with multiple CPUs. The values stored in the !CPU system variable control whether IDL uses the thread pool for a given computation. In addition, you can use the thread pool keywords TPOOL_MAX_ELTS, TPOOL_MIN_ELTS, and TPOOL_NOTHREAD to override the defaults established by !CPU for a single invocation of this routine. See Thread Pool Keywords for details.
To create a 3-element by 4-element integer array with each element set to the value 5, enter: