forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcancel.xml
More file actions
executable file
·61 lines (47 loc) · 2.9 KB
/
Copy pathcancel.xml
File metadata and controls
executable file
·61 lines (47 loc) · 2.9 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
<doc>
<legacy_id>1041</legacy_id>
<name>cancel</name>
<type>command</type>
<syntax>
<example>cancel <i>messageQueueID</i></example>
</syntax>
<synonyms>
</synonyms>
<summary>Removes a <keyword tag="message box">message</keyword> that was queued with the <command tag="send">send</command> <glossary tag="command">command</glossary> and is waiting to be sent.</summary>
<examples>
<example>cancel 2298</example>
<example>cancel item 1 of last line of the pendingMessages</example>
</examples>
<history>
<introduced version="1.0">Added.</introduced>
<deprecated version=""></deprecated>
<removed version=""></removed>
<experimental version=""></experimental>
<nonexperimental version=""></nonexperimental>
</history>
<objects>
</objects>
<platforms>
<mac/>
<windows/>
<linux/>
<ios/>
<android/>
</platforms>
<classes>
<desktop/>
<server/>
<web/>
</classes>
<security>
</security>
<classification>
<category>Objects & Messages</category>
</classification>
<references>
<function tag="pendingMessages">pendingMessages Function</function>
<function tag="flushEvents">flushEvents Function</function>
<command tag="send">send Command</command>
</references>
<description>Use the <b>cancel</b> <glossary tag="command">command</glossary> to get rid of <glossary tag="message">messages</glossary> that were set up but are no longer required.<p></p><p><b>Parameters:</b></p><p>The <i>messageQueueID</i> is the ID number of the <keyword tag="message box">message</keyword>.</p><p></p><p><b>Comments:</b></p><p>The ID number of the message is returned by the <b>send</b> <glossary tag="command">command</glossary> that sent the <keyword tag="message box">message</keyword>. This number is also the first <keyword tag="item">item</keyword> of the line corresponding to the message in the <function tag="pendingMessages">pendingMessages</function> <control_st tag="function">function</control_st>.</p><p></p><p>All pending messages are automatically canceled when the application quits.</p><p></p><p>It is common to need to cancel a number of messages when leaving a card or stack, if the messages only pertain to that card or stack. For example, you might have queued a number of messages that create an animated display on the current card, and need to cancel them when the user goes to another card. The best solution in a case like this is to place each message ID number in a global variable or custom property at the time the <keyword tag="message box">message</keyword> is sent. Then you can cancel all those <glossary tag="message">messages</glossary> in a <control_st tag="repeat">repeat</control_st> <glossary tag="loop">loop</glossary>:</p><p></p><p></p><p> global myPendingMessages -- you've stored the message IDs here</p><p> repeat for each line thisMessageID in myPendingMessages</p><p> cancel thisMessageID</p><p> end repeat</p><p> end closeCard</p></description>
</doc>