handle_to_integerT_handle_to_integerHandleToIntegerHandleToIntegerhandle_to_integer (算子名称)

名称

handle_to_integerT_handle_to_integerHandleToIntegerHandleToIntegerhandle_to_integer — Convert a handle into an integer.

警告

It is not recommended to use this operator in HDevelop. This operator is only provided for reasons of backward compatibility.

参数签名

handle_to_integer( : : Handle : CastedHandle)

Herror T_handle_to_integer(const Htuple Handle, Htuple* CastedHandle)

void HandleToInteger(const HTuple& Handle, HTuple* CastedHandle)

static void HOperatorSet.HandleToInteger(HTuple handle, out HTuple castedHandle)

def handle_to_integer(handle: MaybeSequence[HHandle]) -> Sequence[int]

def handle_to_integer_s(handle: MaybeSequence[HHandle]) -> int

描述

handle_to_integerhandle_to_integerHandleToIntegerHandleToIntegerHandleToIntegerhandle_to_integer converts the handle HandleHandleHandleHandlehandlehandle into an integer representation and returns it in CastedHandleCastedHandleCastedHandleCastedHandlecastedHandlecasted_handle.

If the legacy handle mode is disabled (the default), the ownership of the handle is not transferred. Once all instances of the handle, such as in the tuple HandleHandleHandleHandlehandlehandle, were overwritten, the handle and its content will be destroyed and CastedHandleCastedHandleCastedHandleCastedHandlecastedHandlecasted_handle will become invalid. In that case, if CastedHandleCastedHandleCastedHandleCastedHandlecastedHandlecasted_handle should be passed to code parts that run in legacy handle mode, a reference to the original HandleHandleHandleHandlehandlehandle must be kept in order to avoid clearing the handle.

If the legacy handle mode is enabled, the ownership of the handle is transferred. The handle must then be cleared using clear_handleclear_handleClearHandleClearHandleClearHandleclear_handle or the clear operator of the corresponding semantic type of the handle.

注意

It is not recommended to use this operator in HDevelop. It is solely provided to enable backward compatibility with legacy code.

运行信息

参数表

HandleHandleHandleHandlehandlehandle (input_control)  handle(-array) HHandle, HTupleMaybeSequence[HHandle]HTupleHtuple (handle) (IntPtr) (HHandle) (handle)

The handle to be cast.

CastedHandleCastedHandleCastedHandleCastedHandlecastedHandlecasted_handle (output_control)  pointer(-array) HTupleSequence[int]HTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

The handle cast to an integer value.

结果

如果参数均有效,算子 handle_to_integerhandle_to_integerHandleToIntegerHandleToIntegerHandleToIntegerhandle_to_integer 返回值 2 ( H_MSG_TRUE) . Otherwise, an exception is raised.

参考其它

integer_to_handleinteger_to_handleIntegerToHandleIntegerToHandleIntegerToHandleinteger_to_handle

模块

Foundation