forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdispatch.xml
More file actions
83 lines (67 loc) · 2.94 KB
/
Copy pathdispatch.xml
File metadata and controls
83 lines (67 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<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 "updateWidget"</example>
<example>dispatch "setList" 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>"handled" - the message was handled and not passed</p><p>"unhandled" - no matching handlers were found</p><p>"passed" - 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>