get_dict_paramT_get_dict_paramGetDictParamGetDictParam (Operator)

Name

get_dict_paramT_get_dict_paramGetDictParamGetDictParam — Query dictionary parameters or information about a dictionary.

Signature

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)

Description

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

With each call of get_dict_paramget_dict_paramGetDictParamGetDictParamGetDictParam, 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":

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 GenParamValueGenParamValueGenParamValueGenParamValuegenParamValue. For this query the parameter KeyKeyKeyKeykey must be an empty tuple.

Currently supported key-specific parameter names are:

'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 GenParamValueGenParamValueGenParamValueGenParamValuegenParamValue, one value for each key.

'key_data_type'"key_data_type""key_data_type""key_data_type""key_data_type":

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

Execution Information

Parameters

DictHandleDictHandleDictHandleDictHandledictHandle (input_control)  dict HDict, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Dictionary handle.

Number of elements: DictHandle == 1

GenParamNameGenParamNameGenParamNameGenParamNamegenParamName (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Names of the dictionary parameters or info queries.

Number of elements: GenParamName == GenParamValue

Default value: 'keys' "keys" "keys" "keys" "keys"

List of values: '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", 'keys'"keys""keys""keys""keys"

KeyKeyKeyKeykey (input_control)  string(-array) HTupleHTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

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

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValue (output_control)  tuple(-array) HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Values of the dictionary parameters or info queries.

Example (HDevelop)

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

Result

If all the operator parameters, and the specified keys are valid, get_dict_paramget_dict_paramGetDictParamGetDictParamGetDictParam returns 2 (H_MSG_TRUE). Otherwise an exception is raised.

Possible Predecessors

create_dictcreate_dictCreateDictCreateDictCreateDict

See also

create_dictcreate_dictCreateDictCreateDictCreateDict, set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTuple, get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTuple, set_dict_objectset_dict_objectSetDictObjectSetDictObjectSetDictObject, get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObject, remove_dict_keyremove_dict_keyRemoveDictKeyRemoveDictKeyRemoveDictKey

Module

Foundation