Flushing down the pan

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10140
Joined: Fri Feb 19, 2010 10:17 am

Flushing down the pan

Post by richmond62 » Sun Aug 31, 2025 1:16 pm

I have a stack where all sorts of messages are being sent, and I wish to top everything 'dead', so I decided to use flushEvents,
now, naturally I should send flushEvents("keyUp") as it is inwith a keyUp statement I need to stop everything dead, BUT . . .

. . . I need to send 2 further commands inwith the keyUp command after the events have been flushed.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10140
Joined: Fri Feb 19, 2010 10:17 am

Re: Flushing down the pan

Post by richmond62 » Sun Aug 31, 2025 2:34 pm

Screenshot 2025-08-31 at 16.31.50.png
-
Hairy Fairies.

scott_morrow
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 40
Joined: Tue Jun 27, 2006 8:35 pm
Contact:

Re: Flushing down the pan

Post by scott_morrow » Mon Sep 01, 2025 8:07 am

I see that you are using "send". If you are using "send in time" anywhere then you might want to cancel "pendingMessages" as well.
Elementary Software
...now with 20% less chalk dust!

stam
Posts: 3109
Joined: Sun Jun 04, 2006 9:39 pm

Re: Flushing down the pan

Post by stam » Mon Sep 01, 2025 9:35 am

richmond62 wrote:
Sun Aug 31, 2025 1:16 pm
I have a stack where all sorts of messages are being sent, and I wish to top everything 'dead', so I decided to use flushEvents,
now, naturally I should send flushEvents("keyUp") as it is inwith a keyUp statement I need to stop everything dead, BUT . . .

. . . I need to send 2 further commands inwith the keyUp command after the events have been flushed.
You may find these handlers helpful:

# stop a specific pending pMessage

Code: Select all

on stopPendingMessage pMessage
   repeat for each line tLine in the pendingMessages
      if pMessage is in item 1 of tLine then
         cancel item 1 of tLine
      end if
   end repeat
end stopPendingMessage

# stop all pending messages

Code: Select all

on stopAllPendingMessages
   repeat for each line tLine in the pendingmessages
      cancel item 1 of tLine
   end repeat
end stopAllPendingMessages

Attribution: viewtopic.php?t=20389#p103568

Post Reply