Page 1 of 1

Deleting panding message by name

Posted: Tue May 13, 2014 4:02 pm
by MaxV
I didn't find this method explained, but it's very useful. You can delete pending message by name, without recording message id. For example the following code cancel all pending messages named "myMex":

on cancelmessages
repeat for each line templ in the pendingmessages
if item 3 of templ is "myMex" then
put item 1 of templ into temp
cancel temp
end if
end repeat
end cancelmessages

Re: Deleting panding message by name

Posted: Tue May 13, 2014 5:28 pm
by jmburnod
Hi Max,

I use this:

Code: Select all

--••stop one pending pMessage
on doStopPending pMessage
   repeat for each line aLine in the pendingmessages
      if pMessage is in item 1 of aLine then
         cancel item 1 of aLine
      end if
   end repeat
end doStopPending

--••stop all pending messages
on stopAllPending 
   repeat for each line aLine in the pendingmessages
      cancel item 1 of aLine
   end repeat
end stopAllPending
Best
Jean-Marc