Function _conNewArray() Foundation
Produces a new array container.
ContainerHandle _conNewArray(ULONG ulDim, ...);
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.
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.
/*
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);
}
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.