Skip to content

get_dict_objectGetDictObjectGetDictObjectget_dict_objectT_get_dict_object🔗

Short description🔗

get_dict_objectGetDictObjectGetDictObjectget_dict_objectT_get_dict_object — Retrieve an object associated with the key from the dictionary.

Signature🔗

get_dict_object( out object Object, dict DictHandle, string Key )void GetDictObject( HObject* Object, const HTuple& DictHandle, const HTuple& Key )static void HOperatorSet.GetDictObject( out HObject objectVal, HTuple dictHandle, HTuple key )def get_dict_object( dict_handle: HHandle, key: Union[str, int] ) -> HObject

Herror T_get_dict_object( Hobject* Object, const Htuple DictHandle, const Htuple Key )

HObject HDict::GetDictObject( const HTuple& Key ) const

HObject HDict::GetDictObject( const HString& Key ) const

HObject HDict::GetDictObject( const char* Key ) const

HObject HDict::GetDictObject( const wchar_t* Key ) const (Windows only)

HObject HDict.GetDictObject( HTuple key )

HObject HDict.GetDictObject( string key )

Description🔗

get_dict_objectGetDictObject retrieves an object associated with the Keykeykey from the dictionary denoted by the DictHandledictHandledict_handle. The object has to be previously stored to the dictionary using set_dict_objectSetDictObject.

The operator returns the data in the parameter ObjectobjectValobject. The iconic object is copied by the operation. Therefore, clearing or reusing the dictionary object afterwards will not have any side-effect on the returned iconic object.

If the given Keykeykey is not present in the dictionary or if the data associated with the key is not an object, get_dict_objectGetDictObject fails. Presence of keys and information about the data associated with the key can be verified using get_dict_paramGetDictParam.

HDevelop In-line Operation🔗

HDevelop provides an in-line operation for get_dict_objectGetDictObject, which can be used in an expression in the following syntax:

  • Dynamic syntax:

    Object := DictHandle.['Key']

  • Static syntax:

    Object := DictHandle.Key

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

ObjectobjectValobject (output_object) object(-array) → objectHObjectHObjectHObjectHobject *

Object value retrieved from the dictionary.

DictHandledictHandledict_handle (input_control) dict → (handle)HTuple (HHandle)HDict, HTuple (IntPtr)HHandleHtuple (handle)

Dictionary handle.

Number of elements: DictHandle == 1

Keykeykey (input_control) string → (string / integer)HTuple (HString / Hlong)HTuple (string / int / long)Union[str, int]Htuple (char* / Hlong)

Key string.

Number of elements: Key == 1
Restriction: length(Key) > 0

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_object (Image, Dict, 'my_image')

Result🔗

If the operation succeeds, get_dict_objectGetDictObject 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 object data associated with given key.

Combinations with other operators🔗

Combinations

Possible predecessors

set_dict_objectSetDictObject

Possible successors

get_dict_objectGetDictObject

Alternatives

get_dict_tupleGetDictTuple

See also

create_dictCreateDict, set_dict_tupleSetDictTuple, get_dict_tupleGetDictTuple, set_dict_objectSetDictObject, remove_dict_keyRemoveDictKey, get_dict_paramGetDictParam

Module🔗

Foundation