This API determines if two MQeFields objects are the same by comparing every visible field in the first object with the corresponding visible field in the second object. If the second object does not have a corresponding visible field, or its value is different, then the two MQeFields objects are considered unequal, and the result is '0'. If the two MQeFields objects are not unequal, then the result depends on whether the second MQeFields object contains exactly the same number of visible fields, in which case the result is '1', or more visible fields, in which case the result is '2'. This comparison does not depend on the order in which the fields are inserted or stored in each of the MQeFields objects; all that matters is that both MQeFields objects contain the same fields. The types of the MQeFields objects do not affect the result of the comparison, however both MQeFields objects must be typed (they may not be allocated with type MQE_OBJECT_TYPE_MQE_FIELDS_UNTYPE). The test recurses into nested fields.
#include <hmq.h> MQEINT32 MQeFieldsEquals( MQEHSESS hSess, MQEHFIELDS hFlds1, MQEHFIELDS hFlds2, MQEINT32 * pCompCode, MQEINT32 * pReason)
#include <hmq.h> static MQECHAR const * FieldsType = "com.ibm.mqe.MQeFields"; MQEHSESS hSess; MQEINT32 compcode; MQEINT32 reason; MQEHFIELDS hFlds1, hFlds2; MQEINT32 rc; hSess = MQeInitialize("MyAppsName", &compcode, &reason ); hFlds1 = MQeFieldsAlloc( hSess, FieldsType, &compcode, &reason); hFlds2 = MQeFieldsAlloc( hSess, FieldsType, &compcode, &reason); /* * Add some fields to the fields objects... and one of them is "XYZ" */ ... /* * Now test their equivalence */ rc = MQeFieldsEquals( hSess, hFlds1, hFlds2, &compcode, &reason);