get_dict_paramT_get_dict_paramGetDictParamGetDictParamget_dict_param (算子)

名称

get_dict_paramT_get_dict_paramGetDictParamGetDictParamget_dict_param — 查询字典参数或有关字典的信息。

签名

get_dict_param( : : DictHandle, GenParamName, Key : GenParamValue)

Herror T_get_dict_param(const Htuple DictHandle, const Htuple GenParamName, const Htuple Key, Htuple* GenParamValue)

void GetDictParam(const HTuple& DictHandle, const HTuple& GenParamName, const HTuple& Key, HTuple* GenParamValue)

HTuple HDict::GetDictParam(const HString& GenParamName, const HTuple& Key) const

HTuple HDict::GetDictParam(const HString& GenParamName, const HString& Key) const

HTuple HDict::GetDictParam(const char* GenParamName, const char* Key) const

HTuple HDict::GetDictParam(const wchar_t* GenParamName, const wchar_t* Key) const   ( Windows only)

static void HOperatorSet.GetDictParam(HTuple dictHandle, HTuple genParamName, HTuple key, out HTuple genParamValue)

HTuple HDict.GetDictParam(string genParamName, HTuple key)

HTuple HDict.GetDictParam(string genParamName, string key)

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

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

描述

get_dict_paramget_dict_paramGetDictParamGetDictParamGetDictParamget_dict_param queries current values of dictionary parameters or other information about the dictionary status.

With each call of get_dict_paramget_dict_paramGetDictParamGetDictParamGetDictParamget_dict_param, only a single parameter value can be queried. However, there are two types of parameters/queries:

Key-independent (global) parameter names:

'keys'"keys""keys""keys""keys""keys"

Queries all the keys stored in the dictionary, no matter whether they are associated with tuple or object data. The list of keys is reported as a string tuple via GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value. For this query the parameter KeyKeyKeyKeykeykey must be an empty tuple.

Currently supported key-specific parameter names are:

'key_exists'"key_exists""key_exists""key_exists""key_exists""key_exists"

Reports 1 if the given key is stored in the dictionary, 0 otherwise. The results are reported via GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value, one value for each key.

'key_data_type'"key_data_type""key_data_type""key_data_type""key_data_type""key_data_type"

Reports 'tuple'"tuple""tuple""tuple""tuple""tuple" for keys associated with tuple data within the dictionary (the data can be retrieved using get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTupleget_dict_tuple). Reports 'object'"object""object""object""object""object" for keys associated with object data (the data can be retrieved using get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObjectget_dict_object). The results are reported via GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value, one value for each key. This parameter is useful to decide dynamically whether to use get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTupleget_dict_tuple or get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObjectget_dict_object to get the data of a specific key.

执行信息

参数

DictHandleDictHandleDictHandleDictHandledictHandledict_handle (输入控制)  dict HDict, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Dictionary handle.

元素数量: DictHandle == 1

GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (输入控制)  attribute.name HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Names of the dictionary parameters or info queries.

元素数量: GenParamName == GenParamValue

默认值: 'keys' "keys" "keys" "keys" "keys" "keys"

值列表: 'key_data_type'"key_data_type""key_data_type""key_data_type""key_data_type""key_data_type", 'key_exists'"key_exists""key_exists""key_exists""key_exists""key_exists", 'keys'"keys""keys""keys""keys""keys"

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

Dictionary keys the parameter/query should be applied to (empty for GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name = 'keys'"keys""keys""keys""keys""keys").

默认值: []

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (输出控制)  attribute.value(-array) HTupleSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Values of the dictionary parameters or info queries.

示例(HDevelop)

get_dict_param (Dict, 'keys', [], AllKeys)
get_dict_param (Dict, 'key_data_type', AllKeys, KeysType)

结果

If all the operator parameters, and the specified keys are valid, get_dict_paramget_dict_paramGetDictParamGetDictParamGetDictParamget_dict_param 返回 2 ( H_MSG_TRUE )。否则将抛出异常。

可能的前趋

create_dictcreate_dictCreateDictCreateDictCreateDictcreate_dict

另见

create_dictcreate_dictCreateDictCreateDictCreateDictcreate_dict, set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTupleset_dict_tuple, get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTupleget_dict_tuple, set_dict_objectset_dict_objectSetDictObjectSetDictObjectSetDictObjectset_dict_object, get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObjectget_dict_object, remove_dict_keyremove_dict_keyRemoveDictKeyRemoveDictKeyRemoveDictKeyremove_dict_key

模块

基础