Function _conArrayGetA() Foundation
Assign an element of an array of any dimension to a container.
ContainerHandle _conArrayGetA(ContainerHandle chArray,
ContainerHandle chResult,
int *index);
This function returns a handle to a container that holds the requested value.
The function _conArrayGetA() is used to assign the values of array elements to a container. Xbase++ arrays can contain elements of different types. The value of the array element determined by the pointer index is passed to the container chResult.
#include <windows.h>
#include "xppdef.h"
#include "xpppar.h"
#include "xppcon.h"
XPPRET XPPENTRY MyCAPIFunction(XppParamList paramList)
{
/* Declare and initialize variables */
ContainerHandle chArray;
ContainerHandle chDest;
ContainerHandle chOldValue;
BOOL bchArrayRef;
int index[] = { 1,2,0 };
/* Get array from parameter list. It is expected to */
/* be the first parameter. */
chArray = _conParam( paramList, 1, &bchArrayRef );
/* Get old value from array field [1,2]. */
/* A two dimensional array is expected. */
chOldValue = _conArrayGetA( chArray, NULLCONTAINER, index);
/* Prepare container */
chDest = _conPutC( NULLCONTAINER, "New Value" );
/* Store new value to array field [1,2] */
if (_conArrayPutA( chArray, chDest, index))
{
/* Operation unsuccessful... */
/* ...handle the error. */
}
/* Return old value */
_conReturn( paramList, chOldValue );
/* Release containers */
_conRelease( chArray );
_conRelease( chDest );
_conRelease( chOldValue );
}
/* Xbase++ Code */
PROCEDURE Main
LOCAL aMyArray := { {"A", "A"}, ;
{"B", "B"}, ;
{"C", "C"} }
CLS
? aMyArray
? MyCAPIFunction( aMyArray )
? aMyArray
RETURN
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.