create_dictT_create_dictCreateDictCreateDictcreate_dict (算子)

名称

create_dictT_create_dictCreateDictCreateDictcreate_dict — 创建一个新的空字典。

签名

create_dict( : : : DictHandle)

Herror T_create_dict(Htuple* DictHandle)

void CreateDict(HTuple* DictHandle)

void HDict::HDict()

void HDict::CreateDict()

static void HOperatorSet.CreateDict(out HTuple dictHandle)

public HDict()

void HDict.CreateDict()

def create_dict() -> HHandle

描述

create_dictcreate_dictCreateDictCreateDictCreateDictcreate_dict creates a new empty dictionary and returns it in DictHandleDictHandleDictHandleDictHandledictHandledict_handle

The dictionary serves as an associative array-like container allowing to store an arbitrary number of values associated with unique keys (integers or strings). Each key can refer either to a tuple or to an iconic object. These are stored in the dictionary using set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTupleset_dict_tuple or set_dict_objectset_dict_objectSetDictObjectSetDictObjectSetDictObjectset_dict_object, respectively, from where they can be retrieved again using get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTupleget_dict_tuple or get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObjectget_dict_object

The data stored in the dictionary is always a copy of the original data, being it control parameters or objects. The original data can thus be reused immediately after the set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTupleset_dict_tuple or set_dict_objectset_dict_objectSetDictObjectSetDictObjectSetDictObjectset_dict_object calls. The following particularities apply:

执行信息

此算子返回一个句柄。请注意,即使该句柄被用作特定算子的输入参数,这些算子仍可能改变此句柄类型的实例状态。

参数

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

Handle of the newly created dictionary.

元素数量: DictHandle == 1

示例(HDevelop)

Dicts := []
for idx := 0 to 4 by 1
  create_dict (DictHandle)
  Dicts[idx] := DictHandle
endfor
* ...

结果

Returns 2 ( H_MSG_TRUE) unless a resource allocation error occurs.

可能的后继

set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTupleset_dict_tuple, set_dict_objectset_dict_objectSetDictObjectSetDictObjectSetDictObjectset_dict_object

另见

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, get_dict_paramget_dict_paramGetDictParamGetDictParamGetDictParamget_dict_param

模块

基础