get_dict_tupleT_get_dict_tupleGetDictTupleGetDictTupleget_dict_tuple (Operator)

Name

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

Signature

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]

Description

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.

The operator 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.

Execution Information

Parameters

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.

Example (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)

Result

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.

Possible Predecessors

set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTupleset_dict_tuple

Possible Successors

get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTupleget_dict_tuple, set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTupleset_dict_tuple, set_dict_tuple_atset_dict_tuple_atSetDictTupleAtSetDictTupleAtSetDictTupleAtset_dict_tuple_at

Alternatives

get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObjectget_dict_object

See also

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

Module

Foundation