set_message_tuple
— Add a key/tuple pair to the message.
set_message_tuple( : : MessageHandle, Key, TupleData : )
set_message_tuple
stores a tuple associated with a key in the
message, which behaves as a dictionary-like data container.
The message is denoted by the MessageHandle
parameter.
TupleData
including strings is copied by the operation, and can
thus be immediately reused.
An empty tuple is considered as a valid value that can be associated with
the key.
If any data (tuple or object) was already associated with given key
(Key
), the old data is destroyed by set_message_tuple
and replaced by TupleData
.
The Key
has to be a string or an integer.
String keys are treated case sensitive.
The tuple data for the given key can be retrieved again from the message
using get_message_tuple
.
Note that if the tuple contains any handles (which are treated as simple integers) only the handle values are copied by the operation, not the resources behind those handles.
This operator modifies the state of the following input parameter:
The value of this parameter may not be shared across multiple threads without external synchronization.
MessageHandle
(input_control, state is modified) message →
(handle)
Message handle.
Number of elements: MessageHandle == 1
Restriction: MessageHandle != 0
Key
(input_control) string →
(string / integer)
Key string or integer.
Number of elements: Key == 1
TupleData
(input_control) tuple-array →
(string / integer / real / handle)
Tuple value to be associated with the key.
create_message (Message) set_message_tuple (Message, 'simple_integer', 27) set_message_tuple (Message, 'simple_string', 'Hello world') set_message_tuple (Message, 'mixed_tuple', ['The answer', 42])
If the operation succeeds, set_message_tuple
returns 2 (H_MSG_TRUE).
Otherwise an exception is raised. Possible error conditions include
invalid parameters (handle or key) or resource allocation error.
enqueue_message
,
set_message_obj
create_message
,
clear_message
,
get_message_tuple
,
set_message_obj
,
get_message_obj
,
set_message_param
,
get_message_param
,
enqueue_message
,
dequeue_message
Foundation