set_dict_tuple
— Add a key/tuple pair to the dictionary.
set_dict_tuple( : : DictHandle, Key, Tuple : )
set_dict_tuple
stores a tuple associated with a key in the
dictionary.
The dictionary is denoted by the DictHandle
parameter.
Tuple
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_dict_tuple
and replaced by Tuple
.
The Key
has to be a string or an integer.
Strings are treated case sensitive.
The tuple data for the given key can be retrieved again from the dictionary
using get_dict_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:
During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.
DictHandle
(input_control, state is modified) dict →
(handle)
Dictionary handle.
Number of elements: DictHandle == 1
Key
(input_control) string →
(string / integer)
Key string.
Number of elements: Key == 1
Restriction: length(Key) > 0
Tuple
(input_control) tuple-array →
(string / integer / real)
Tuple value to be associated with the key.
create_dict (Dict) set_dict_tuple (Dict, 'simple_integer', 27) set_dict_tuple (Dict, 'simple_string', 'Hello world') set_dict_tuple (Dict, 'mixed_tuple', ['The answer', 42]) set_dict_tuple (Dict, 0, 'This is zero')
If the operation succeeds, set_dict_tuple
returns 2 (H_MSG_TRUE).
Otherwise an exception is raised. Possible error conditions include
invalid parameters (handle or key) or resource allocation error.
create_dict
,
get_dict_tuple
,
set_dict_object
,
get_dict_object
,
get_dict_param
,
remove_dict_key
Foundation