$msginfo

Return the requested information about the latest message.

$msginfo(Topic)

Example: putmess "%%$msginfo("DST") has received a message."

Parameters

Parameters
Parameter Data Type Description
Topic String Valid topic name. The topic name is not case-sensitive; you can use uppercase or lowercase letters, or any combination of these to increase readability.

Topics and Return Values

Values returned by $msginfo per Topic
Topic Return value
DATA The message data associated with the message. For more information, see $msgdata.
DST Intended destination for message. For more information, see $msgdst.
ID The message ID associated with the message. For more information, see $msgid.
INSTANCENAME The name of the instance that sent the message. For more information, see $instancename.
INSTANCEPATH The path of the instance that sent the message. For more information, see $instancepath.
SRC

Sender of message. For more information, see $msgsrc.

Use

Allowed only in the receiveMessage trigger of components.

Allowed in all component types except self-contained Report and Services.

Description

The information returned in $msginfo is available using the individual functions $instancename, $instancepath, $msgdata, $msgdst, $msgid, and $msgsrc.

Using $msginfo

The following code could appear in the receiveMessage trigger of a component:

postmessage $msginfo("SRC"),"MSG001", %\
"Reply to sender: message received."

To handle messages that are incorrectly addressed, the following code could appear in the receiveMessage trigger of the application:

postmessage $msginfo("SRC"), "MSG001", %\
"Reply to sender: instance addressed is unknown"

Related Topics