set_dict_tuple_at — 为字典中的一个或多个元组元素分配一个或几个值。
set_dict_tuple_at( : : DictHandle, Key, Index, Value : )
set_dict_tuple_at assigns a single value to one or several
elements of a tuple, or it assigns a number of values elementwise to the
specified elements of a tuple that is stored in DictHandle
under the key Key.
The operator allows to efficiently replace parts of a tuple stored
in a dictionary without first reading the previous values from the
dictionary.
If the dictionary does not yet contain a tuple under the given key, or if the given key maps to an iconic value, a new tuple is created and stored under the given key. In the latter case, the iconic object previously stored under that key is removed from the dictionary.
If the passed indices are out of the current range of the tuple stored in the dictionary, the tuple length is increased and the new values are initialized to a default value.
The Key has to be a string or an integer.
Strings are treated case sensitive.
The Index parameter can be any expression that evaluates to any
number of positive integer values.
The Value parameter must evaluate to exactly one value or to
the same number of indices that are provided via the Index
parameter.:
The tuple data for the given key can be retrieved again from the dictionary
using get_dict_tuple。
Note that if Value contains any handles, only the handle values
are copied by the operation, not the resources behind those handles.
此算子修改后续输入参数的状态:
在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。
DictHandle (输入控制,状态被修改) dict → (handle)
Dictionary handle.
元素数量: DictHandle == 1
Key (输入控制) string → (string / integer)
Key string.
元素数量: Key == 1
限制:
length(Key) > 0
Index (输入控制) integer-array → (integer)
Indices of the elements that have to be replaced by the new value(s).
默认值: 0
建议值: 0, 1, 2, 3, 4, 5, 6
最小增量: 1
Value (输入控制) tuple-array → (string / integer / real / handle)
Value(s) that is to be assigned.
Dict := dict{}
Dict.some_key := 27
set_dict_tuple_at (Dict, 'some_key', 1, 5)
* Dict.some_key is now [27, 5]
* Alternative TRIAS syntax
Dict.some_key[0] := 66
* Dict.some_key is now [66, 5]
If the operation succeeds, set_dict_tuple_at 返回 2 ( H_MSG_TRUE )。否则将抛出异常。 Possible error conditions include
invalid parameters or resource allocation error.
set_dict_tuple,
get_dict_tuple
create_dict,
set_dict_tuple,
get_dict_tuple,
set_dict_object,
get_dict_object,
get_dict_param,
remove_dict_key
基础