<doc>
	<legacy_id>3515</legacy_id>
	<name>dispatch</name>
	<type>command</type>

	<syntax>
		<example>dispatch <i>message</i> [ to <i>target</i> ][ with <i>argumentList</i> ]</example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Sends a message to an object via the normal message path.</summary>

	<examples>
<example>dispatch &quot;updateWidget&quot;</example>
<example>dispatch &quot;setList&quot; with tNewList</example>
	</examples>

	<history>
		<introduced version="3.5">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
		<ios/>
		<android/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
		<mobile/>
	</classes>

	<security>
	</security>


	<classification>
		<category>Writing LiveCode</category>
	</classification>

	<references>
		<command tag="send">send Command</command>
		<property tag="behavior">behavior Property</property>
		<keyword tag="me">me Keyword</keyword>
		<keyword tag="it">it Keyword</keyword>
		<message tag="closeControl">closeControl Message</message>
		<message tag="preOpenControl">preOpenControl Message</message>
		<control_st tag="on">on Control Structure</control_st>
	</references>

	<description>
	<overview>Use the <b>dispatch</b> command to send a mesage to an object, via the message path and find out whether it was handled or not.</overview>

		<parameters>
<parameter>
<name>message</name>
<description> Is an expression that evaluates to the name of a handler.</description>
</parameter>
<parameter>
<name>target</name>
<description>Is a reference to any LiveCode object.</description>
</parameter>
<parameter>
<name>argumentList</name>
<description>Is a comma separated list of expressions containing the arguments to send.</description>
</parameter>		</parameters>

	<value>Once finished, the variable '<keyword tag="it">it</keyword>' contains one of the following three values:<p></p><p>&quot;handled&quot; - the message was handled and not passed</p><p>&quot;unhandled&quot; - no matching handlers were found</p><p>&quot;passed&quot; - the message was handled but passed by all handlers</p></value>
	<comments>The <b>dispatch</b> command is most useful when using <property tag="behavior">behaviors</property>, as it allows a <property tag="behavior">behavior</property> script to send an 'event' to one of its child objects and then perform an action depending on the outcome.<p></p><p>Executing a <b>dispatch</b> command causes the <i>message</i> to be sent to the target object with the given argument list. This message passes through the message path in the normal way.</p><p></p><p>If no <i>target</i> is specified, the <i>message</i> is sent to '<keyword tag="me">me</keyword>'. In the context of a <property tag="behavior">behavior</property>, this is typically the child that is executing rather than the <property tag="behavior">behavior</property> object itself.</p></comments>
	</description>
</doc>