Skip to content

remove_dict_keyRemoveDictKeyRemoveDictKeyremove_dict_keyT_remove_dict_key🔗

Short description🔗

remove_dict_keyRemoveDictKeyRemoveDictKeyremove_dict_keyT_remove_dict_key — Remove keys from a dictionary.

Signature🔗

remove_dict_key( dict DictHandle, string Key )void RemoveDictKey( const HTuple& DictHandle, const HTuple& Key )static void HOperatorSet.RemoveDictKey( HTuple dictHandle, HTuple key )def remove_dict_key( dict_handle: HHandle, key: MaybeSequence[Union[str, int]] ) -> None

Herror T_remove_dict_key( const Htuple DictHandle, const Htuple Key )

void HDict::RemoveDictKey( const HTuple& Key ) const

void HDict::RemoveDictKey( const HString& Key ) const

void HDict::RemoveDictKey( const char* Key ) const

void HDict::RemoveDictKey( const wchar_t* Key ) const (Windows only)

void HDict.RemoveDictKey( HTuple key )

void HDict.RemoveDictKey( string key )

Description🔗

remove_dict_keyRemoveDictKey removes the keys specified in Keykeykey from the dictionary passed in DictHandledictHandledict_handle and releases all the (tuple or object) data associated with those keys.

If an error occurs while processing one or more keys (in particular if a key is invalid), the operator attempts to continue removing as many keys as possible before reporting an appropriate failure.

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.

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters🔗

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

Dictionary handle.

Number of elements: DictHandle == 1

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

Key to remove.

Restriction: length(Key) > 0

Example🔗

(HDevelop)

* Remove all keys
get_dict_param (Dict, 'keys', [], Keys)
remove_dict_key (Dict, Keys)

Result🔗

If all the operator parameters are valid, remove_dict_keyRemoveDictKey returns 2 (H_MSG_TRUE). Otherwise an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

create_dictCreateDict

Possible successors

get_dict_paramGetDictParam

See also

create_dictCreateDict, set_dict_tupleSetDictTuple, get_dict_tupleGetDictTuple, set_dict_objectSetDictObject, get_dict_objectGetDictObject, get_dict_paramGetDictParam

Module🔗

Foundation