MakeArray

(System Library)

Description: Create and initialize a one-dimensional array with one line of code.
Returns: Array
Usage: Script Only.
Function Groups: Array
Related to: New
Format: System.MakeArray(Elem1, Elem2, ...)
Parameters:  
Elem1, Elem2
Elements for the new array
Comments:

A maximum of 100 elements can be provided. Multi-dimensional arrays can be created by calling MakeArray() for each of the elements.

If the MakeArray() call is passed as a function argument, a temporary array is created and will be destroyed when the function ends.

This module is a member of the System Library, and must therefore be prefaced by \System. as shown in the "Format" section.

If your application predates version 11.2, use the backslash notation rather than dot: \System\

Examples:

Create an array of data type names.

DataTypes = System.MakeArray("Byte", "Short", "Long", "Float", "String", "Octal", "Hex", "Unknown");

Create a temporary array for a single use in a function.

 SomeFunction(System.MakeArray(1, 2, 3));
{ is equivalent to:                         }
 A = New(3);
 A[0] = 1; 
 A[1] = 2; 
 A[2] = 3; 
 SomeFunction(A); 
 A = Invalid;  { free up memory }