remove_dict_keyT_remove_dict_keyRemoveDictKeyRemoveDictKeyremove_dict_key (Operator)
Name
remove_dict_keyT_remove_dict_keyRemoveDictKeyRemoveDictKeyremove_dict_key
— Remove keys from a dictionary.
Signature
Herror T_remove_dict_key(const Htuple DictHandle, const Htuple Key)
void RemoveDictKey(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)
def remove_dict_key(dict_handle: HHandle, key: MaybeSequence[Union[str, int]]) -> None
Description
remove_dict_keyremove_dict_keyRemoveDictKeyRemoveDictKeyremove_dict_key
removes the keys specified in KeyKeyKeykeykey
from
the dictionary passed in DictHandleDictHandleDictHandledictHandledict_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
- 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
DictHandleDictHandleDictHandledictHandledict_handle
(input_control, state is modified) dict →
HDict, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Dictionary handle.
Number of elements:
DictHandle == 1
KeyKeyKeykeykey
(input_control) string(-array) →
HTupleMaybeSequence[Union[str, int]]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (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_keyremove_dict_keyRemoveDictKeyRemoveDictKeyremove_dict_key
returns
2 (
H_MSG_TRUE)
. Otherwise an exception is raised.
Possible Predecessors
create_dictcreate_dictCreateDictCreateDictcreate_dict
Possible Successors
get_dict_paramget_dict_paramGetDictParamGetDictParamget_dict_param
See also
create_dictcreate_dictCreateDictCreateDictcreate_dict
,
set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleset_dict_tuple
,
get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleget_dict_tuple
,
set_dict_objectset_dict_objectSetDictObjectSetDictObjectset_dict_object
,
get_dict_objectget_dict_objectGetDictObjectGetDictObjectget_dict_object
,
get_dict_paramget_dict_paramGetDictParamGetDictParamget_dict_param
Module
Foundation