mqAddInteger
The mqAddInteger call adds an integer item identified by a user selector to the end of a specified bag.
Syntax for mqAddInteger
- mqAddInteger (Bag, Selector, ItemValue, CompCode, Reason)
Parameters for mqAddInteger
- Bag (MQHBAG) - input
- Handle of the bag to be modified.
This must be the handle of a bag created by the user, not the handle of a system bag. MQRC_SYSTEM_BAG_NOT_ALTERABLE results if the value you specify identifies a system bag.
- Selector (MQLONG)
- Selector identifying the item to be added to the bag.
If the selector is less than zero (that is, a system selector), MQRC_SELECTOR_OUT_OF_RANGE results.
If the selector is zero or greater (that is, a user selector) and the bag was created with the MQCBO_CHECK_SELECTORS option or as an administration bag (MQCBO_ADMIN_BAG), the selector must be in the range MQIA_FIRST through MQIA_LAST; if not, again MQRC_SELECTOR_OUT_OF_RANGE results.
If MQCBO_CHECK_SELECTORS was not specified, the selector can be any value of zero or greater.
If the call is creating a second or later occurrence of a selector that is already in the bag, the data type of this occurrence must be the same as the data type of the first occurrence; MQRC_INCONSISTENT_ITEM_TYPE results if it is not.
- ItemValue (MQLONG) - input
- The integer value to be placed in the bag.
- CompCode (MQLONG) - output
- Completion code.
- Reason (MQLONG) - output
- Reason code qualifying CompCode.
The following
reason codes indicate error conditions that can be returned from the mqAddInteger call:
- MQRC_HBAG_ERROR
- Bag handle not valid.
- MQRC_INCONSISTENT_ITEM_TYPE
- Data type of this occurrence of selector differs from data type of first occurrence.
- MQRC_SELECTOR_OUT_OF_RANGE
- Selector not within valid range for call.
- MQRC_STORAGE_NOT_AVAILABLE
- Insufficient storage available.
- MQRC_SYSTEM_BAG_NOT_ALTERABLE
- System bag cannot be altered or deleted.
Usage notes for mqAddInteger
- If a data item with the specified selector is already present in the bag, an additional instance of that selector is added to the end of the bag. The new instance is not necessarily next to the existing instance.
- This call cannot be used to add a system selector to a bag.
C language invocation for mqAddInteger
mqAddInteger (Bag, Selector, ItemValue, &CompCode, &Reason)Declare the parameters as follows:
MQHBAG Bag; /* Bag handle */ MQLONG Selector; /* Selector */ MQLONG ItemValue; /* Integer value */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code qualifying CompCode */
Visual Basic invocation for mqAddInteger
(Supported on Windows only.)
mqAddInteger Bag, Selector, ItemValue, CompCode, ReasonDeclare the parameters as follows:
Dim Bag As Long 'Bag handle' Dim Selector As Long 'Selector' Dim ItemValue As Long 'Integer value' Dim CompCode As Long 'Completion code' Dim Reason As Long 'Reason code qualifying CompCode'Parent topic: MQAI calls