get_dict_tupleT_get_dict_tupleGetDictTupleGetDictTupleget_dict_tuple (算子名称)

名称

get_dict_tupleT_get_dict_tupleGetDictTupleGetDictTupleget_dict_tuple — Retrieve a tuple associated with the key from the dictionary.

参数签名

get_dict_tuple( : : DictHandle, Key : Tuple)

Herror T_get_dict_tuple(const Htuple DictHandle, const Htuple Key, Htuple* Tuple)

void GetDictTuple(const HTuple& DictHandle, const HTuple& Key, HTuple* Tuple)

HTuple HDict::GetDictTuple(const HTuple& Key) const

HTuple HDict::GetDictTuple(const HString& Key) const

HTuple HDict::GetDictTuple(const char* Key) const

HTuple HDict::GetDictTuple(const wchar_t* Key) const   ( Windows only)

static void HOperatorSet.GetDictTuple(HTuple dictHandle, HTuple key, out HTuple tuple)

HTuple HDict.GetDictTuple(HTuple key)

HTuple HDict.GetDictTuple(string key)

def get_dict_tuple(dict_handle: HHandle, key: MaybeSequence[Union[str, int]]) -> Sequence[Union[int, float, str]]

def get_dict_tuple_s(dict_handle: HHandle, key: MaybeSequence[Union[str, int]]) -> Union[int, float, str]

描述

get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTupleget_dict_tuple retrieves a tuple associated with the KeyKeyKeyKeykeykey from the dictionary denoted by the DictHandleDictHandleDictHandleDictHandledictHandledict_handle. The tuple has to be previously stored to the dictionary using set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTupleset_dict_tuple.

该算子 returns the data in the parameter TupleTupleTupleTupletupletuple. The data including strings is copied by the operation, the dictionary can thus be immediately reused.

If the given KeyKeyKeyKeykeykey is not present in the dictionary or if the data associated with the key is not a tuple, get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTupleget_dict_tuple fails. Presence of keys and information about the data associated with the key can be verified using get_dict_paramget_dict_paramGetDictParamGetDictParamGetDictParamget_dict_param.

Obtaining the values for multiple keys at once is only possible if for each of those keys, the dictionary contains a tuple with a single element.

运行信息

参数表

DictHandleDictHandleDictHandleDictHandledictHandledict_handle (input_control)  dict HDict, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Dictionary handle.

Number of elements: DictHandle == 1

KeyKeyKeyKeykeykey (input_control)  string(-array) HTupleMaybeSequence[Union[str, int]]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Key string.

TupleTupleTupleTupletupletuple (output_control)  tuple(-array) HTupleSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Tuple value retrieved from the dictionary.

例程 (HDevelop)

* ...
get_dict_param (Dict, 'key_exists', ['simple_string','foo','my_image'], \
                KeysPresence)
get_dict_param (Dict, 'key_data_type', ['simple_string','my_image'], \
                KeysType)
get_dict_tuple (Dict, 'simple_string', TupleString)
*
* Access multiple keys, if their tuple all have length 1
get_dict_tuple (Dict, ['key1','key2','key3'], MultipleValues)

结果

If the operation succeeds, get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTupleget_dict_tuple returns 2 ( H_MSG_TRUE) . Otherwise an exception is raised. Possible error conditions include invalid parameters (handle or key), the required key not found in the dictionary, or other than tuple data associated with given key.

可能的前置算子

set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTupleset_dict_tuple

可能的后置算子

get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTupleget_dict_tuple, set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTupleset_dict_tuple, set_dict_tuple_atset_dict_tuple_atSetDictTupleAtSetDictTupleAtSetDictTupleAtset_dict_tuple_at

可替代算子

get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObjectget_dict_object

参考其它

create_dictcreate_dictCreateDictCreateDictCreateDictcreate_dict, set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTupleset_dict_tuple, set_dict_objectset_dict_objectSetDictObjectSetDictObjectSetDictObjectset_dict_object, get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObjectget_dict_object, remove_dict_keyremove_dict_keyRemoveDictKeyRemoveDictKeyRemoveDictKeyremove_dict_key, get_dict_paramget_dict_paramGetDictParamGetDictParamGetDictParamget_dict_param

模块

Foundation