Function _conNewArray() Foundation

Produces a new array container.

Syntax
ContainerHandle _conNewArray(ULONG ulDim, ...);
Parameters
ULONG ulDim
Number of dimensions of the new array (at least 1).
. . .
The remaining arguments must be of the ULONG type and indicate the number of elements in each array dimension. Note:There must be exactly as many values indicated as there are dimensions defined with <ulDim>.
Return

Returns the handle of a new array container when the operation is successful. The function returns NULLCONTAINER when insufficient memory is available for the new array container.

Description

A new container of the type array is created with _conNewArray(). The array created can have any number of dimensions and any number of elements in each dimension. The theoretic limit is ULONG_MAX (= 4,294,967,295). Very large arrays may significantly slow down the garbage collection.

Each container created with the _conNewArray() function must be released with _conRelease() when it is no longer needed. If it is not released, memory space is lost which can not be recovered by the garbage collector.

Examples
/* 
Creates an array with 1 x 2 x 10000 elements and 
determines the error if the operation fails. 
*/ 
#include <xppcon.h> 

ContainerHandle  hArray; 
XPPAPIRET        xr; 


hArray = _conNewArray(3, 1, 2, 10000); 
if (hArray == NULLCONTAINER) 
{ 
xr = _conLastError(); 
/* ... error handling */ 
} 
else 
{ 
/* ... operations with the array container */ 

_conRelease(hNew); 
} 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.