If an error occurs, returns the source count of the offending element or '-1'.
#include <hmq.h> MQEINT32 MQeFieldsGetArray( MQEHSESS hSess, MQEHFIELDS hFlds, MQECHAR * pName, MQEBYTE * pDataType, MQEINT32 sOff, MQEVOID * pDstBuf, MQEINT32 dstLen, MQEVOID *pBase, MQEINT32 * pCompCode, MQEINT32 * pReason)
#include <hmq.h>; static MQECHAR const * FieldsType = "com.ibm.mqe.MQeFields"; static MQEINT32 intBuf[4] = { 0x12345678, 0xDEADBEEF, 0xC0D1F1ED, 0x1DEC0DED}; MQEHSESS hSess; MQEINT32 compcode; MQEINT32 reason; MQEHFIELDS hFlds; MQEBYTE datatype; MQEINT32 n; MQEINT32 rc; MQEINT32 * buf; #define NULL 0 hSess = MQeInitialize("MyAppsName", &compcode, &reason); hFlds = MQeFieldsAlloc( hSess, FieldsType, &compcode, &reason); /* * Add some fields to the fields object... and one of them is the array "XYZ" */ MQeFieldsPutArray( hSess, hFlds, "XYZ", MQE_TYPE_INT, intBuf, 4, &compcode, &reason); /* Get the field data length and datatype */ n = MQeFieldsGetArray( hSess, hFlds, "XYZ", &datatype, 0, NULL, 0, NULL, &compcode, &reason); /* Get some space to put the data */ buf = malloc( n * MQE_SIZEOF(datatype)); /* Get the field data */ rc = MQeFieldsGetArray( hSess, hFlds, "XYZ", &datatype, 0, buf, n, NULL, &compcode, &reason);