set_message_paramT_set_message_paramSetMessageParamSetMessageParamset_message_param (算子)

名称

set_message_paramT_set_message_paramSetMessageParamSetMessageParamset_message_param — 设置消息参数或对消息调用命令。

签名

set_message_param( : : MessageHandle, GenParamName, Key, GenParamValue : )

Herror T_set_message_param(const Htuple MessageHandle, const Htuple GenParamName, const Htuple Key, const Htuple GenParamValue)

void SetMessageParam(const HTuple& MessageHandle, const HTuple& GenParamName, const HTuple& Key, const HTuple& GenParamValue)

void HMessage::SetMessageParam(const HString& GenParamName, const HTuple& Key, const HTuple& GenParamValue) const

void HMessage::SetMessageParam(const HString& GenParamName, const HString& Key, const HTuple& GenParamValue) const

void HMessage::SetMessageParam(const char* GenParamName, const char* Key, const HTuple& GenParamValue) const

void HMessage::SetMessageParam(const wchar_t* GenParamName, const wchar_t* Key, const HTuple& GenParamValue) const   ( Windows only)

static void HOperatorSet.SetMessageParam(HTuple messageHandle, HTuple genParamName, HTuple key, HTuple genParamValue)

void HMessage.SetMessageParam(string genParamName, HTuple key, HTuple genParamValue)

void HMessage.SetMessageParam(string genParamName, string key, HTuple genParamValue)

def set_message_param(message_handle: HHandle, gen_param_name: str, key: MaybeSequence[Union[str, int]], gen_param_value: MaybeSequence[Union[int, float, str]]) -> None

描述

set_message_paramset_message_paramSetMessageParamSetMessageParamSetMessageParamset_message_param sets message parameters or invokes action commands on the message.

For each call of set_message_paramset_message_paramSetMessageParamSetMessageParamSetMessageParamset_message_param, only a single parameter can be set. However, there are two types of parameters/commands:

Key-independent parameter names:

'remove_all_keys'"remove_all_keys""remove_all_keys""remove_all_keys""remove_all_keys""remove_all_keys"

Removes all the keys currently stored in the message and releases all the (control or iconic) data associated with those keys. The operation results in an empty message. Note that contents of GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value is ignored for this parameter, while KeyKeyKeyKeykeykey must be an empty tuple.

Key-specific parameter names:

'remove_key'"remove_key""remove_key""remove_key""remove_key""remove_key"

Removes the keys specified in the KeyKeyKeyKeykeykey parameter 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 the key is invalid), the operator attempts to continue removing as many keys as possible before reporting the failure. Note that the contents of GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value is ignored for this parameter.

执行信息

此算子修改后续输入参数的状态:

在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。

参数

MessageHandleMessageHandleMessageHandleMessageHandlemessageHandlemessage_handle (输入控制,状态被修改)  message HMessage, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Message handle.

元素数量: MessageHandle == 1

限制: MessageHandle != 0

GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Names of the message parameters or action commands.

元素数量: GenParamName == 1

默认值: 'remove_key' "remove_key" "remove_key" "remove_key" "remove_key" "remove_key"

值列表: 'remove_all_keys'"remove_all_keys""remove_all_keys""remove_all_keys""remove_all_keys""remove_all_keys", 'remove_key'"remove_key""remove_key""remove_key""remove_key""remove_key"

KeyKeyKeyKeykeykey (输入控制)  string(-array) HTupleMaybeSequence[Union[str, int]]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Message keys the parameter/command should be applied to.

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (输入控制)  tuple(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Values of the message parameters or action commands.

示例(HDevelop)

* Remove some keys
set_message_param (Message, 'remove_key', ['my_image', 'simple_string'], [])

结果

If all the operator parameters, and their values, as well as specified keys are valid, set_message_paramset_message_paramSetMessageParamSetMessageParamSetMessageParamset_message_param 返回 2 ( H_MSG_TRUE )。否则将抛出异常。

可能的前趋

dequeue_messagedequeue_messageDequeueMessageDequeueMessageDequeueMessagedequeue_message, create_messagecreate_messageCreateMessageCreateMessageCreateMessagecreate_message

可能的后继

enqueue_messageenqueue_messageEnqueueMessageEnqueueMessageEnqueueMessageenqueue_message, clear_messageclear_messageClearMessageClearMessageClearMessageclear_message

另见

create_messagecreate_messageCreateMessageCreateMessageCreateMessagecreate_message, clear_messageclear_messageClearMessageClearMessageClearMessageclear_message, set_message_tupleset_message_tupleSetMessageTupleSetMessageTupleSetMessageTupleset_message_tuple, get_message_tupleget_message_tupleGetMessageTupleGetMessageTupleGetMessageTupleget_message_tuple, set_message_objset_message_objSetMessageObjSetMessageObjSetMessageObjset_message_obj, get_message_objget_message_objGetMessageObjGetMessageObjGetMessageObjget_message_obj, get_message_paramget_message_paramGetMessageParamGetMessageParamGetMessageParamget_message_param, enqueue_messageenqueue_messageEnqueueMessageEnqueueMessageEnqueueMessageenqueue_message, dequeue_messagedequeue_messageDequeueMessageDequeueMessageDequeueMessagedequeue_message

模块

基础