Item property
Purpose
The Item property represents an item in a bag. It is used to set or inquire about the value of an item. Use of this property corresponds to the following MQAI calls:- "mqSetString"
- "mqSetInteger"
- "mqInquireInteger"
- "mqInquireString"
- "mqInquireBag"
Format
Item (Selector, ItemIndex, Value)
Parameters
- Selector (VARIANT) - input
- Selector of the item to be set or inquired.
When inquiring about an item, MQSEL_ANY_USER_SELECTOR is the default. When setting an item, MQIA_LIST or MQCA_LIST is the default.
If the Selector is not of type long, MQRC_SELECTOR_TYPE_ERROR results.
This parameter is optional.
- ItemIndex (LONG) - input
- This value identifies the occurrence of the item of the specified selector that is to be set or inquired on. MQIND_NONE is the default.
This parameter is optional.
- Value (VARIANT) - input/output
- The value returned or the value to be set. When inquiring about an item, the return value can be of type long, string, or MQBag. However, when setting an item, the value must be of type long or string; if not, MQRC_ITEM_VALUE_ERROR results.
Visual Basic Language Invocation
When inquiring about a value of an item within a bag:Value = mqbag[.Item]([Selector], [ItemIndex])For MQBag references:
Set abag = mqbag[.Item]([Selector]. [ItemIndex])To set the value of an item in a bag:
mqbag[.Item]([Selector], [ItemIndex]) = Value