$msgsrc
Return the name of the component instance that sent the message.
$msgsrc
Example: putmess "Message received from %%$msgsrc."
Return Values
String identifying the component instance that sent the message, if the receiveMessage trigger was activated by a postmessage statement. The string contains all the path information necessary to reply to the message.
In addition, $msgid returns a
non-empty string. If the receiveMessage trigger was not
activated by postmessage, $msgid returns an empty string
(""
).
Use
Allowed only in a receiveMessage trigger.
Allowed in all component types.
Using $msgsrc
The following code could appear in the receiveMessage trigger of a component:
postmessage $msgsrc, "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 $msgsrc, "MSG001", "Reply to sender: instance addressed is unknown"